PDA

View Full Version : Query Help


Serge
03-15-2003, 01:43 AM
Ok I have this query so far.


$result = mysql_query("select articleid, title, adate, email, author, body from article WHERE articleid = $id") or
die (mysql_error());


Really all I need to know is that will this query give me all the fields I want from only the one that has the matching articleid? Also the php script is called read.php so If I were to have read.php?id=1 will I need to make any extra code or will it take it right from the address and use it in the script?

filburt1
03-15-2003, 01:46 AM
It looks fine to me.

BTW before going on get into the habit of capitalizing MySQL keywords like SELECT, FROM, etc. It makes it much easier to read.

Re: the $id...if this is a vB page, you're fine. If not, add this before the query:

$id = $_REQUEST['id'];