Dynadot โ€” .com Registration $8.99

Need help fixing an SQL error, will pay..

Spaceship Spaceship
Watch

calibreezer

Established Member
Impact
1
Now I can change the ads through the admin backend, but all of a sudden for an unknown reason I went to change them and got this

Query error:
UPDATE sitead SET adtext = AD CODE WAS HERE' WHERE adname='ad4'

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 'AD URL WAS HERE' at line 1


It's been at it for a few days, and some ads work some ads don't.. It's weird, if anyone wants to take a shot at it feel free O_O
 
Last edited by a moderator:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
.US domains.US domains
remember to enclose the ad code in single quotes. Also run the ad code through mysql_real_escape_string()

Something like the following :-


PHP:
$db = mysql_connect(host, username, password);
mysql_select_db(dbname, $db);
$ad_code = 'AD CODE WAS HERE';
mysql_query('UPDATE sitead SET adtext = \'.'mysql_real_escape_string($ad_code, $db).\' WHERE adname=\'ad4\';', $db);
 
0
•••
I don't know where I would find the code to edit that. I also tried adding single quotes (' ') around the ad but still same problem
 
0
•••
if you post the code could have a look
 
0
•••
Peter said:
if you post the code could have a look

Well that's the prob. The code from which file? O_O
 
0
•••
calibreezer said:
Well that's the prob. The code from which file? O_O
If you're not writing the code, you need to tell us that. You need to tell us who did or which software package you're using. We can't magically figure that out from this. Your best bet right now is to consult the programmer's documentation.
 
0
•••
I'm using vidiscript www.Vidiscript.com

The support ****ing blows for it, so pretty soon (probably within the next few checks I get from it) I will pay for a custom script based off of that...
 
0
•••
try these step


1.Did you check the table SITEAD? is it exist on the DB ?

2.Did you found the coloum adtext and adnname in the table SITEAD

3.I think you already add (') in front of [AD CODE WAS HERE],
But let me ask you again
Did you already change the syntax to:
UPDATE sitead SET adtext = 'AD CODE WAS HERE' WHERE adname='ad4'

or

UPDATE sitead SET adtext = 'Testing' WHERE adname='ad4'

:blink:
 
0
•••
If the script used to work and now doesn't it could be that your web host has changed the setting of magic_quotes in the php.ini file. Magic quotes automatically escapes quote characters in user input. The script may rely on magic quotes being enabled to work correctly.

You may be able to fix this by adding the following to your .htaccess file (or creating a new .htaccess file containing the following line if one does not already exist).

Code:
php_flag magic_quotes_gpc on

Note: I would not recommend relying on magic quotes for escaping mysql query strings. This feature is going to be removed in PHP6 anyway.
 
0
•••
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back