PDA

View Full Version : bulletin generator, mysql error


BaldNut
12-01-2001, 09:09 AM
hi, i installed this hack, everthing went fine until i press preview e-mail and i get this:


Database error in vBulletin Control Panel 2.2.0:

Invalid SQL: SELECT userid,username,birthday FROM user WHERE SUBSTRING(birthday,6)>='11-29' AND SUBSTRING(birthday,6)<='12-13' ORDER BY SUBSTRING(birthday,6) LIMIT 0,10
mysql error: You have an error in your SQL syntax near 'SUBSTRING(birthday,6) LIMIT 0,10' at line 1

mysql error number: 1064

Date: Thursday 29th of November 2001 03:16:25 PM
Script: http://www.golden-springs.com/forum...in/commbull.php
Referer: http://www.golden-springs.com/forums/admin/commbull.php


any ideas ?

Palmer ofShinra
12-01-2001, 05:52 PM
In commbull.php

Search for SUBSTRING(birthday,6)

The string there probably reads...

$DB_Site->query("SELECT userid,username,birthday FROM user WHERE SUBSTRING(birthday,6)>='11-29' AND SUBSTRING(birthday,6)<='12-13' ORDER BY SUBSTRING(birthday,6) LIMIT 0,10");

It should be

$DB_Site->query("SELECT userid,username,birthday FROM user WHERE ".SUBSTRING(birthday,6).">='11-29' AND ".SUBSTRING(birthday,6)."<='12-13' ORDER BY ".SUBSTRING(birthday,6)." LIMIT 0,10");

Mind you, I've never seen this script, but that's what appears to be the problem and solution to me.

BaldNut
12-02-2001, 08:09 AM
i changed that m8, and now it displays this

Fatal error: Call to a member function on a non-object in /home/sites/site4/web/forums/admin/commbull.php on line 722

which is the line i just changed ?

but its not as bad an error as i was getting lol

Palmer ofShinra
12-02-2001, 11:39 PM
Is

global $DB_site;

in there somewhere?

christec
12-03-2001, 02:16 AM
[QUOTE]Originally posted by Palmer ofShinra
In commbull.php

Search for SUBSTRING(birthday,6)

The string there probably reads...

$DB_Site->query("SELECT userid,username,birthday FROM user WHERE SUBSTRING(birthday,6)>='11-29' AND SUBSTRING(birthday,6)<='12-13' ORDER BY SUBSTRING(birthday,6) LIMIT 0,10");

It should be

$DB_Site->query("SELECT userid,username,birthday FROM user WHERE ".SUBSTRING(birthday,6).">='11-29' AND ".SUBSTRING(birthday,6)."<='12-13' ORDER BY ".SUBSTRING(birthday,6)." LIMIT 0,10");

Mind you, I've never seen this script, but that's what appears to be the problem and solution to me.