Hey all. Say if i had these columns n rows in a MySQL table: Name: Last Name: John Philips How would i get it using php to display all the data in my database one under the other? Thanks.
Dude, looking at your posts today, why don't you go read some tutorials or buy a book? You'll keep asking all these questions all day long unless you educate yourself. This is so basic but you only provide one piece of the puzzle. We can't help like this.
i reccomend "John Wiley & Sons - Beginning PHP, Apache, MySQL Web Development" book, everything you must know is there.
you sould known SQL commands to excute and get information from database . - you connect to database ( mysql_connect ) $link=mysql_connect($server_host,$user,$pass); PHP: - you select a database ( Select DB ) mysql_select_db($dbname,$link); PHP: - you set a query for get information from DB ( SQL Queries ) $query = "SELECT `name`,`lastname` FROM table_name"; PHP: - you excute that's Query ( Query Excute ) $result=mysql_query($query); PHP: - you use a circle to get all information from query result .(Fetch Arrays ) while ($user = mysql_fetch_array($result )) { print "name : " .$user['name'] ."Last name : ". $user['lastname']; } PHP: - Finished . [ Learn more about While Circle ] i recommend you see php reference website . ( http://www.php.net ) and Documentation ( http://ir.php.net/docs.php ) have a nice day
This is indeed a very generic question and there is no way we can answer that in 1 post as it will trigger more questions. I suggest that you take a look at a tutorial, here is one that looks good: http://www.php-mysql-tutorial.com/connect-to-mysql-using-php.php it will give you the idea.