FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » take two - fetch items from a row.
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
take two - fetch items from a row. [message #181295] Fri, 03 May 2013 23:02 Go to previous message
richard is currently offline  richard   
Messages: 213
Registered: June 2013
Karma:
Senior Member
This code may reside on a page in a line.
< a href="http:www.code.com/gettable.php?number=1">


Where I show id=$number, is that the way I want to show it or is there a
beter way?
I want to retrieve the row corresponding to the id number given in the
link.

<?php


$number=$_GET["number"];
if (empty($number)) {$number=1;}
$number=(int)$number;

// connections code left out intentionally //


$result = mysql_query("SELECT id,email FROM people WHERE id = $number");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
$row = mysql_fetch_row($result);

echo $row[0]; // 42
echo $row[1]; // the email value
?>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: SoapServer constructor parameters: what is actor uri?
Next Topic: replacing spaces with newline
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 09:28:42 GMT 2024

Total time taken to generate the page: 0.04913 seconds