Question by murdok_007: MySQL Errors? Please Help!?
#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 ‘ define("DB_SERVER", "localhost")' at line 1 That's exactly what I get, and I'm not sure why. I don't have a ' after localhost"); , but that says I do. If I need to supply more information, please just email me and I will give the rest of the code, here's a small snippet /** * Constants.php * * This file is intended to group all constants to * make it easier for the site administrator to tweak * the login script. * * Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC) * Last Updated: August 19, 2004 */ /** * Database Constants - these constants are required * in order for there to be a successful connection * to the MySQL database. Make sure the information is * correct. */ define("DB_SERVER", "localhost"); define("DB_USER", murdok_"Murdok"); I am currently loading this into my phpMyAdmin "Run SQL Quero/queries on database murdok_Games" window. phpMyAdmin says my usernames are murdok_Admin and murdok_Murdok. Also isn't that required? Best answer:
Answer by Ghotherkill
Try this. This is what I always use:
$ con = mysql_connect(“localhost”,”root”) or die(mysql_error());
$ db = mysql_select_db(“answerthis”, $ con);
Know better? Leave your own answer in the comments!
There are no revisions for this post.