run sql on server problem

ezryder

Member
Apr 30, 2004
7
0
151
Hi,
I am trying to run some sql on my webhost. I have connected to the database fine but when I try this code:

Code:
$sql = "SELECT TeacherUser FROM teachers                     
              WHERE TeacherUser='$TeacherUser';";
      $result = mysql_query($sql)
                  or die("Couldn't execute query. $sql");
The result is:

Couldn't execute query. SELECT TeacherUser FROM teachers WHERE TeacherUser='d';

I know my sql works because I can run it through cpanel sql screen fine. The only other reason I can think of for it not working is maybe because I developed on windows and am now uploading to a unix server and the mysql_query function needs tweaking in my code???

If anyone can help I'd appreciate it.
Thanks

Sorry this probably should be in the scripting/backend forum:)
 

ezryder

Member
Apr 30, 2004
7
0
151
Nothing I'm afraid, I started out without the ";" and then added it because I thought maybe a unix server needed it. :(