Jump to content

[SOLVED] edit article fields - how can i dedicate the id ?


redpedia

Recommended Posts

Hello

 

I've a problem , I've made a insert page and edit page for simple article, in the edit page , I've put a article name and edit , delete links

 

first problem is when i move the mouse above the edit link it gives this link in the IE status bar

 

http://localhost/news/edit_outputarticle.php?=0000000001

 

Why there is many of zeros ! , while i just have to records in the database !

 

Problem two , I've made an Output edit article page to edit the article fields , the problem is i can't dedicate to the code that i need article number 1 or 2 or 3 ... with where syntax .

 

here is the code

 

 

<?php

include "config.php";

$query=mysql_query("select * from article where id=");

$fetch=mysql_fetch_array($query);
?>

 

what should i put in where syntax here ?

 

thanks in advance

 

Not sure what the zero's are for but you might want to fix that first. There should also be a name for the value.

http://localhost/news/edit_outputarticle.php?id=0000000001

 

As far a getting the id for your query

use this

<?php
include "config.php";
$id = $_GET['id'];
$query=mysql_query("select * from article where id='$id'");

$fetch=mysql_fetch_array($query);
?>

 

Ray

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.