Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7760293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:50:57+00:00 2026-06-01T13:50:57+00:00

I am using it to do with PHP. ERROR:- You have an error in

  • 0

I am using it to do with PHP.

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

EDIT 1:

$SQLQUERY = sprintf("SELECT pd_serial FROM product_details WHERE pd_model_type=%s AND pd_model_name=%s AND pd_model_version=%s AND pd_product_group=%s LIMIT 1",
GetSQLValueString($modeltype, "text"),
GetSQLValueString($modelname, "text"),
GetSQLValueString($modelversion, "text"),
GetSQLValueString($modelgroup, "text"));
$QUERYEXEC =  mysql_query($SQLQUERY, $dacreint) or die("OOPS! Please try again.");

while ($QUERYFETCH = mysql_fetch_array($QUERYEXEC))
{
    $pdserial = $QUERYFETCH['pd_serial'];
}

EDIT 2:

while ($QUERYFETCH = mysql_fetch_array($QUERYEXEC))
{
    $pdserial = $QUERYFETCH['pd_serial'];
}
$SQLQUERY = sprintf("SELECT product_serial_no FROM products WHERE product_serial_no = '$product_serial_no'");
$TCcount_QE = mysql_query($SQLQUERY, $dacreint) or die(mysql_error());
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T13:50:58+00:00Added an answer on June 1, 2026 at 1:50 pm

    You should put strings within single quotes. And make sure you have escaped those string values using mysql_real_escape_string() or similar function

    SELECT pd_serial FROM product_details WHERE (pd_model_type='%s' AND pd_model_name='%s') AND (pd_model_version='%s' AND pd_model_group='%s') LIMIT 1
    

    UPDATE 1

                while ($QUERYFETCH = mysql_fetch_array($QUERYEXEC))
                {
                    $pdserial = $QUERYFETCH['pd_serial'];
                }
        // let's comment out the following line
            //    $SQLQUERY = sprintf("SELECT product_serial_no FROM products WHERE product_serial_no = '$product_serial_no'");
    // and modifying it as:
                $SQLQUERY = sprintf("SELECT product_serial_no FROM products WHERE product_serial_no = %s", GetSQLValueString($product_serial_no, "text"));
                $TCcount_QE = mysql_query($SQLQUERY, $dacreint) or die(mysql_error());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

You have an error in your SQL syntax; check the manual that corresponds to
I have a page called Error.php. Variables are usually passed to it using the
How do I correct the following error that is listed below. I'm using PHP
I have this mysql query using PHP and first part is working fine, but
I'm having some trouble with a SQL transaction using PHP and mySQL. Here is
Whenever i try using php with lighttpd on my iphone i get error 500
i am using php and mail function , but i face this error: Warning:
I am using following PHP code for trigger creation but always get error, please
I am using this php code: exec(unrar e file.rar,$ret,$code); and getting an error code
I'm using prepared statements and MySQLi, and am currently getting this error. PHP Catchable

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.