Helllooooooo,
In latest two posts I have shown you how to connect to a mysql database via PHP, and in another one I teach you how to select rows from a mysql database table. In this one I will show you how to extract that rows from mysql and print them out into a page. Let’s suppose we have a database which contains fields : id, full_name, age. Ok, next step is connecting to db, then making a query to select those fields and finally extract & print them on the screen :
$query_db = "select * from table_Name"; $result_db = mysql_query($query_db); while($row=@mysql_fetch_object($result_db) { print "$row->full_name it's $row->age years old"; }
We used a while() loop to extract all results!
Isn’t PHP rocking?
Would have been worth it to mention the other option: mysql_fetch_array. After all, everyone learns basic programming first and then the concept of OOP and how to work with it.
ok, appreciate your advice but honestly it’s my blog and I make the rules here