Re: [PHP] Select record by ID
- From: c3.nitrox@xxxxxxxxxxx ("nitrox .")
- Date: Tue, 30 Jan 2007 17:14:20 -0500
Thanks to all who have replied. As you probably have noticed im a total novice to php who is trying to achieve big things.
Richard, ive included your suggested code and now my php script is working properly. But I dont want to be a php copy/paste newb who has no clue of how things are working. If its not too much would you (or anybody) give a brief explanation of what this code is doing? Or are there any tutorials online that I can read that will educate me on this? Thanks again to all for your replies. Ive saved them all for future reference.
atleast this part: $user_id = mysql_real_escape_string((int) $_GET['user_id']);
I understand the rest.
<?php
include "db.php";
$user_id = mysql_real_escape_string((int) $_GET['user_id']);
$query = "SELECT user_id, user_name FROM inf_member WHERE user_id=$user_id";
$result = mysql_query($query);
if ( ! $result ) {
die ("Could not perform query $query: ".mysql_error()."\n");
}
while($myrow = mysql_fetch_assoc($result))
{
echo "<br>";
echo $myrow['user_name'];
echo "<br>";
}
?>
_________________________________________________________________
Invite your Hotmail contacts to join your friends list with Windows Live Spaces http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
.
- Follow-Ups:
- Re: [PHP] Select record by ID
- From: Paul Novitski
- Re: [PHP] Select record by ID
- Prev by Date: Re: Passing a url-specified value through a form
- Next by Date: RE: [PHP] Can't get PHP extension to Load
- Previous by thread: XML error in browser
- Next by thread: Re: [PHP] Select record by ID
- Index(es):
Relevant Pages
|