KeithF Posted April 23, 2010 Share Posted April 23, 2010 I'm new at working with MySQL, and while uploading my database to the server i recieved the following error; #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<? $conn = mysql_connect("localhost", "root", "D3f14nc3") or die(mysql_error()' at line 1 <? /** * Connect to the mysql database. */ $conn = mysql_connect("localhost", "username", "password") or die(mysql_error()); mysql_select_db('Defiance', $conn) or die(mysql_error()); ?> Obviously where i have the words username and password, i have my username and password. What's wrong with my code? Thanks in advance for any help. Link to comment https://forums.phpfreaks.com/topic/199530-error-1064/ Share on other sites More sharing options...
Ken2k7 Posted April 23, 2010 Share Posted April 23, 2010 and while uploading my database to the server O.O woah... Wait, are you trying to run that code in MySQL? That's PHP code. Link to comment https://forums.phpfreaks.com/topic/199530-error-1064/#findComment-1047266 Share on other sites More sharing options...
KeithF Posted April 23, 2010 Author Share Posted April 23, 2010 Ok, like i said i'm totally new at this :-\ and i thought to set up a password/login system for your website that you had to place your database php in your MySQL on your server. Have i got this totally wrong? Link to comment https://forums.phpfreaks.com/topic/199530-error-1064/#findComment-1047271 Share on other sites More sharing options...
Ken2k7 Posted April 23, 2010 Share Posted April 23, 2010 PHP and MySQL are different. PHP is a programming language. MySQL is a database. I would look up a log in system and see how they do it. Go from there. Link to comment https://forums.phpfreaks.com/topic/199530-error-1064/#findComment-1047284 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.