Getting and displaying

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
NeoPuma
Forum Commoner
Posts: 26
Joined: Sat Mar 06, 2004 12:18 pm
Location: South Wales, UK
Contact:

Getting and displaying

Post 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
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

read the mysql manual found here

i know this is there because i was reading it last night
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post 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.
Post Reply