Page 1 of 1

Getting and displaying

Posted: Mon Mar 08, 2004 9:44 am
by NeoPuma
Hi,
I'm really new to PHP and MySQL, so please be patient :). I got a connection to my MySQL, Now i wanna load some info from it. If theres more than one record in the same Field (Only one of the fields), it'll just show one and not the others...Also, it would only create as many table rows (As in a HTML Table) as there is rows (loaded from MySQL) and they all must have the same entry in the field 'Letter' (in this case, 'A'), how i do this?

Thanks
-Neo

Posted: Mon Mar 08, 2004 10:17 am
by malcolmboston
read the mysql manual found here

i know this is there because i was reading it last night

Posted: Tue Mar 09, 2004 2:18 am
by JAM
Continues malcolmboston tip's; Search for 'distinct' records in the mysql manual.

To produce the same amount of <tr><t/tr> as the sql rows (just pseudo code to get you thinking, needs more stuff):

Code: Select all

echo '<table>';
while ($row = mysql_fetch_array($result)) {
 echo '<tr><td>' . $row['fieldname'] . '</td></tr>';
}
echo '</table>';
...and they all must have the same entry in the field 'Letter' (in this case, 'A')...
As you use in an <input type="text"> box you mean? Lookup the mysql manual again and 'where' clauses.
How to use form input's; good start is to lookup about $_POST in the php manual and the user contributed examples...

Hope that helped more, and good luck.