Help with getting Data from Table
Posted: Tue Mar 03, 2009 9:43 am
Hi guys, I am new to this forum and hope I can find some help.
I am new to PHP and MySql, infact I am new to programming!
Basically, I am trying to pull data from my database using the code below, but only the first record gets pulled out. I am not sure if I am using arrays correctly either!
What would I put in the echo section to display all the data from all the records?
Can anyone help?
Thank you in advance
I am new to PHP and MySql, infact I am new to programming!
Basically, I am trying to pull data from my database using the code below, but only the first record gets pulled out. I am not sure if I am using arrays correctly either!
What would I put in the echo section to display all the data from all the records?
Can anyone help?
Thank you in advance
Code: Select all
query = "SELECT * FROM Persons";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
$Name = $row['Name'];
$Java = $row['Java'];
$Leadership = $row['Leadership'];
$Communication = $row['Communication'];
$Teamwork = $row ['Team_Work'];
$Problem_Solving = $row['Problem_Solving'];
}
$get_java = mysql_query("SELECT Name, Java FROM Persons WHERE
AND Java>=(SELECT Java FROM Job_Spec WHERE Project_Name='Manager')");
$Java3 = mysql_fetch_array($get_java);
{
// Displays results
echo "";
}
?>