hmmmmmmmmmmmmmmmmm what seems to be the problem in here?? it has no output but i think my query is ok, can someone help?? plzzzzzzzzzzzzzzzzzzzzzzz $query=" SELECT ta.Last_Name, ta.First_Name, co.CoMaker_Last_Name, co.CoMaker_First_Name, ta.Position, tc.type, ta.Salary, tc.Allowance, tc.Total_Deductions, tc.Net_Take_Home_Pay, tc.Total_Leave, c.Years_in_Service, tc.Remaining_Years_in_Service FROM tbl_certification tc, tbl_client c, tbl_loanform lf, tbl_comaker co, tbl_agency ta where ta.Employee_ID_NO = c.Employee_ID_NO AND c.client_num = lf.client_num AND co.CoMaker_ID_Number = ta.Employee_ID_NO AND c.client_num = co.client_num AND tc.form_num = lf.form_num AND lf.form_num = '$formnum' order by tc.type asc"; $result=mysql_query($query); echo mysql_error(); echo "<form name=\"myform\" method=\"post\" action=\"gate_viewcertificate.php\">"; //////////////// Now we will display the returned records in side the rows of the table///////// while($noticia = mysql_fetch_array($result)) { if($bgcolor=='#f1f1f1'){$bgcolor='#ffffff';} else{$bgcolor='#f1f1f1';} $lname=$noticia['Last_Name']; $fname=$noticia['First_Name']; $colname=$noticia['CoMaker_Last_Name']; $cofname=$noticia['CoMaker_First_Name']; $Position=$noticia['Position']; $Salary=$noticia['Salary']; $Allowance=$noticia['Allowance']; $Total_Deductions=$noticia['Total_Deductions']; $Net_Take_Home_Pay=$noticia['Net_Take_Home_Pay']; $Total_Leave=$noticia['Total_Leave']; $Years_in_Service=$noticia['Years_in_Service']; $Remaining_Years_in_Service=$noticia['Remaining_Years_in_Service']; $type=$noticia['Type']; $co_pos=$noticia['CoMaker_Position']; if ($type==1){ $last=$lname; $first=$fname; $pos=$Position;} else{$last=$colname; $first=$cofname; $pos=$co_pos;} echo "<tr >"; echo "<td align='left' bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".ucwords($last)." ".ucwords($first)." </font></td>"; echo "<td align='center' bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".ucwords($pos)."</font></td>"; echo "<td align='center' bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".number_format($Salary)."</font></td>"; echo "<td align='center' bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".number_format($Allowance)."</font></td>"; echo "<td align='center' bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".number_format($Total_Deductions)."</font></td>"; echo "<td align='center' bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".number_format($Net_Take_Home_Pay)."</font></td>"; echo "<td align='center' bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".number_format($Total_Leave)."</font></td>"; echo "<td align='center' bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".number_format($Years_in_Service)."</font></td>"; echo "<td align='center' bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".number_format($Remaining_Years_in_Service)."</font></td>"; echo "</tr>"; } echo "</table><p> </p>";
When you say no output, do you mean do data is being displayed or the script is failing? Have you run your sql query directly in your sql client?
no data outputted but there is no error in my query. yes i run it directly on my mysql client hmmmmmm im using 5 tables maybe it cant handle that much table,
It'll handle them fine in PHP. Try seeing whether there's any data coming back from the query by echoing the number of rows: $result=mysql_query($query); echo mysql_num_rows($result);
You should probably also look at using PDO instead of mysql_query() since mysql_query() been recommended for removal in PHP6. http://php.net/manual/en/book.pdo.php http://php.tutorialref.com/pdo-mysql-connect-example.html