+ Reply to Thread
Results 1 to 3 of 3
Like Tree2Likes
  • 1 Post By corewerx
  • 1 Post By adamssida

Thread: MDB2 Syntax Error

  1. #1
    corewerx is offline x10Hosting Member corewerx is an unknown quantity at this point
    Join Date
    Apr 2008
    Posts
    2

    Question MDB2 Syntax Error

    Anyone want to take a stab at telling me where the syntax error is in this block of code:

    PHP Code:
    $dbtable 'cw_users';
    $dbfields = array ('text''text''text''text''date''date''integer''text''integer''integer');
    $dbdata = array('user_name' => $username'user_password' => $password'user_key' => $userkey'user_region' => $region'user_born' => $birthdate'user_register' => $regdate'user_balance' => 0'user_theme' => 'Default''user_level' => 1'user_status' => 1);

    $affectedRows $mdb2->extended->autoExecute($dbtable$dbdataMDB2_AUTOQUERY_INSERTnull$dbfields);

    if (
    PEAR::isError($affectedRows)) {
        die(
    $affectedRows->getMessage());

    In addition ot the basic MDB2 library with the MySQL driver, I have both the manager and extended modules loaded and tested... But now, testing my first insert into my DB is not working... I keep getting the following from my test app:

    Production Core Werx Registration Pass Senard (260352, 290304) Damian McLeod 73de2b24-ede6-4f70-a518-b5748489c897 cc8424e6f5473a32e644b3aa8292849b471dc506 2006-10-12 2008-04-06MDB2 Error: syntax error
    The code that generates everything up to the MDB2 / PHP code posted above has been tested six ways from Sunday and then some, by four different developers, but alas, I am the only one working on the actual DB code, as the PHP side of the app is my domain... Somewhere along the MDB2 calls are throwing a syntax error and I have double checked everything against the PEAR Manual pages for MDB2, and a couple of other reference sites... Any ideas that you may have as to the glitch are welcome...

    EDIT:

    PHP Code:
    $affectedRows $mdb2->extended->autoExecute($dbtable$dbdataMDB2_AUTOQUERY_INSERTnull$dbfields); 
    Further testing has revealed this line to be the culprit but I don't see any errors in it... Thoughts?
    Last edited by corewerx; 04-07-2008 at 12:50 AM. Reason: Marking out potential error line...
    dinomirt96 likes this.

  2. #2
    adamssida is offline x10Hosting Member adamssida is an unknown quantity at this point
    Join Date
    Oct 2009
    Posts
    1

    Re: MDB2 Syntax Error

    Quote Originally Posted by corewerx View Post
    Anyone want to take a stab at telling me where the syntax error is in this block of code:

    EDIT:

    PHP Code:
    $affectedRows $mdb2->extended->autoExecute($dbtable$dbdataMDB2_AUTOQUERY_INSERTnull$dbfields); 
    Further testing has revealed this line to be the culprit but I don't see any errors in it... Thoughts?
    Have a look at the definition of autoExecute:
    bool|MDB2_Error autoExecute( string $table, array $fields_values, [int $mode = MDB2_AUTOQUERY_INSERT], [string $where = false], [array $types = null], [string $result_class = true], [mixed $result_types = MDB2_PREPARE_MANIP])

    You have entered "null" for "$where". Try with "false" instead.
    karimirt47 likes this.

  3. #3
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: MDB2 Syntax Error

    Quote Originally Posted by adamssida View Post
    You have entered "null" for "$where". Try with "false" instead.
    1. null is a perfectly valid value for the $where argument. The documentation for autoExecute even uses null.
    2. Note the date of the first post. Don't revive dead threads.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread

Similar Threads

  1. Need help with Syntax Error
    By tam-iam in forum Scripts & 3rd Party Apps
    Replies: 0
    Last Post: 02-25-2008, 07:21 AM
  2. XHTML help please
    By mac173 in forum Graphics & Webdesign
    Replies: 3
    Last Post: 01-29-2008, 11:39 AM
  3. Php MDB2 Error for mysql
    By rivaljo1 in forum Free Hosting
    Replies: 3
    Last Post: 11-14-2007, 02:43 PM
  4. Parse error: syntax error, unexpected
    By Fr33z4r in forum Free Hosting
    Replies: 12
    Last Post: 11-04-2007, 06:12 PM
  5. {req} Banners
    By SEŅOR in forum The Marketplace
    Replies: 23
    Last Post: 01-05-2006, 03:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers