Forum Moderators: coopster
mysql_data_seek($ODisplay, 0);
$row_ODisplay = mysql_fetch_assoc($ODisplay);
do{
Display Stuff here (Hopefully the real stuff) - sometimes I get a blank display sometimes I get a duplicate item
I use: echo $row_ODisplay['FieldName'];
}while($row_ODisplay = mysql_fetch_assoc($ODisplay));
Should I be using foreach{} or something else?
Thanks
M
$link = mysql_connect("localhost","user","password") or die(mysql_error());
mysql_select_db("db_name",$link);
$query = "SELECT * FROM table_name";
$result = mysql_query($query,$link) or die(mysql_error());
while($row = mysql_fetch_array($result)) {
echo $row['col_name1'].'<br />'.$row['col_name2'];//etc...
}
mysql_close($link);
You may also want to look at our library [webmasterworld.com] for some good threads on Basics of extracting data from MySQL using PHP [webmasterworld.com]
Good luck!
Go to these links:
Good luck
Thanks tons! I really feel like I am in and endless spiral!
M