Php remote server error!!!!!!!!!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Locked
binkabir
Forum Newbie
Posts: 3
Joined: Sat Nov 21, 2009 2:20 pm

Php remote server error!!!!!!!!!!

Post by binkabir »

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
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Php remote server error!!!!!!!!!!

Post by John Cartwright »

Duplicate. Locked.
Locked