Code to select certain records in a table and display
Posted: Sun Apr 22, 2007 4:29 pm
Jcart | Please use
Jcart | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
This code is suppose to select all the names in a table named yahoo that have an id of 44 and display them on the screen.
Any help would be greatly appreciated.Code: Select all
<?php
$conn=mysql_connect("127.0.0.1", "odbc", "") ;
mysql_select_db("uah",$conn);
$sql = "Select name from yahoo where id=44";
mysql_query($sql,$conn) ;
$result = mysql_query($sql,$conn);
while ($array = mysql_fetch_array($result)) {
print "$array['name']";
};
?>Jcart | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]