<?php
$dbhost = 'mysql';
$dbuser = 'username';
$dbpass = 'password';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die('Error connecting to mysql');
mysql_select_db("cms", $conn);
$query = "SELECT * FROM news";
$result = mysql_query($query, $conn);
$result_ar = mysql_fetch_assoc($result);
print_r($result_ar);
?>
Im having some problems with this script… instead of getting me all the information from the “news” table like I am trying to tell it to do, I am only getting back one of the rows from the table… I have three rows on the table right now, and when I do the print_r(); on the array, i only get this:
Array
(
[id] => 1
[title] => Testing
[author] => Rob Carrillo
[date] => 4/23/08
[content] => this is just a test!!!
)