Acmlm's Board - I2 Archive - Programming - php/mysql help needed
User | Post |
spiroth10
Posts: 9/21 |
Update: hmm... another browsing through the php.net manual revealed that all I needed was to add in the word and... I'll post the code, because no on seemed to know what to do anyway (no replies):
new code([ instead of < again...): $db="spiroth_fakedb"; $link = mysql_connect('localhost', 'fakename', 'fakepass'); if (! $link) die("Couldn't connect to MySQL"); mysql_select_db($db , $link) or die("Couldn't open $db: ".mysql_error()); $result = mysql_query( "SELECT gname FROM ginfo" ) or die("SELECT Error: ".mysql_error()); $link2 = mysql_query( "SELECT glink FROM ginfo" ) or dies("SELECT Error: ".mysql_error()); print "[table width=200 border=1][h3 align=left][div id=head2]Game Info: [/h3][/div][br]\n"; while ($get_info = mysql_fetch_row($result) and $get_link = mysql_fetch_row($link2)){ print "[tr]\n"; $num_rows = mysql_num_rows($result); $num_rows2 = mysql_num_rows($link2); foreach ($get_link as $field2); foreach ($get_info as $field); print "\t[td][font face=arial size=3/][li][a href=$field2]$field[/a][/li][/a][/font][/td]\n"; print "[/tr]\n"; }
all I did differently here (other than the and operator) was rearrange the code a beat to clean it up, add a URL to $field, and give it a cool bullet... hope this will help someone... |
|