Jump to content


Photo

Moved to new server and upgraded to PHP5 .... now I have two errors!


  • Please log in to reply
5 replies to this topic

#1 mrwebbie

mrwebbie
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 11 September 2006 - 02:25 AM

Okay, a little background.  I didn't write these databases or create the php pages.  So, you'll need to be gentle with me. :)  I know enough to be dangerous, but I'm mainly just a maintainer here...not a designer.

Anyway, I was recently moved to an upgraded server by my host, and in the process, we went ahead and upgraded to PHP 5.0.  I have two databases with 5 applications running off of one and one off of the other.  Everything is working just fine on the database with the multiple applications, but on the other database, I have a problem with two functions.

The first searchs for a record so it can be updated.  You can get to a point where you can choose the record you want, but when you do, this is the error you get:

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 '' at line 1

Here is the code in line 1 -- 

<?php require_once('Connections/julian.php'); ?>

Okay, the second error is from a page that functions similar to the one above but it will actually delete a record.  Again, you can get to a point where you can select the record you want to delete, but then you get this error:

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 'and clients.advocate_id = advocates.advocate_id and clients.race_id = race.race_' at line 1

Here is the code in line 1 --

<?php require_once('Connections/julian.php'); ?>

Obviously, even a noob like me can see that the line 1 thing may not be the issue.  So, I'm really at a loss.  It is just weird that these are the only two things that are giving me any problems.

So please help! :)

Nick


#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 11 September 2006 - 03:44 AM

These are sql errors, not php. You need to find (and post) the relevent sql statements.

#3 mrwebbie

mrwebbie
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 11 September 2006 - 12:05 PM

Hmm, and to totally cop to my ignorance, how would I do that?

#4 mainewoods

mainewoods
  • Members
  • PipPipPip
  • Advanced Member
  • 685 posts
  • LocationMaine

Posted 11 September 2006 - 04:42 PM

you need to load the source file specified into an editor:
<?php require_once('Connections/julian.php'); ?>
-the error is within the 'Connections/julian.php' file


#5 mrwebbie

mrwebbie
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 12 September 2006 - 06:23 PM

Okay, that makes sense, however, the julian.php file is identicle to connection file.  So, I am not sure why it would be the problem here.

Here is the copy of the connection file: (I've X'd out the username and password)

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_julian = "localhost";
$database_julian = "juliancenter_org_-_vawa";
$username_julian = "XXXXXXXX";
$password_julian = "XXXXXXXX";
$julian = mysql_pconnect($hostname_julian, $username_julian, $password_julian) or die(mysql_error());
?>


I'm so confused :)

#6 mainewoods

mainewoods
  • Members
  • PipPipPip
  • Advanced Member
  • 685 posts
  • LocationMaine

Posted 12 September 2006 - 07:13 PM

If it is complaining about sql syntax, then it would be the sql used in the function:
mysql_query();
you don't show that function or the sql code in it above




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users