php remote server error!!!!!!!!!!
Posted: Sat Nov 21, 2009 2:43 pm
hello all,
i designed an application that is working on my localhost computer but generals error when i host to on my web hosting server
i actually used a php variable in an sql select statement
an example of my code
<?php
$student_subject = array('mathematics', 'economics','physics','chemistry');
for ($i=0;$<count($student_subject);$i++){
$sql = "select total,exam from $student_subject[$i] " ;
$result = myqli_query($conn,$sql) or die ();
$row = mysqli_fetch_assoc($result);
echo $row['total']. "</br>";
}
?>
this code works perfectly well in my localhost server on my computer system but
generates errors on a remote web host.
(that is cannot query the sql statement ) this seems to me that the php variable in the sql is not working)
please can any one help me ?
this code
i designed an application that is working on my localhost computer but generals error when i host to on my web hosting server
i actually used a php variable in an sql select statement
an example of my code
<?php
$student_subject = array('mathematics', 'economics','physics','chemistry');
for ($i=0;$<count($student_subject);$i++){
$sql = "select total,exam from $student_subject[$i] " ;
$result = myqli_query($conn,$sql) or die ();
$row = mysqli_fetch_assoc($result);
echo $row['total']. "</br>";
}
?>
this code works perfectly well in my localhost server on my computer system but
generates errors on a remote web host.
(that is cannot query the sql statement ) this seems to me that the php variable in the sql is not working)
please can any one help me ?
this code