Solved

SQl statements getting parse errors

Posted on 2007-03-20
7
213 Views
Last Modified: 2007-03-21
Can you tell me what looks wrong with this?

$PremiumFound = false;
$NormalFound = false;

$conn = mysql_connect("","","");
mysql_select_db("providers",$conn);

$SQLStrings(0) = mysql_query("SELECT Top 1 * FROM tblAdspace where tblAdspace.strProviderservice = '" .$_REQUEST['strProviderservice']. "' AND (tblAdspace.strZipcode = '" .$_REQUEST['strZipcode']. "' OR tblAdspace.strTown = '" .$_REQUEST['strTown']. "') AND  tblAdspace.strAd_size = 'Premium'")
or die(mysql_error());

$SQLStrings(1) = mysql_query("SELECT * FROM tblAdspace where tblAdspace.strProviderservice = '" .$_REQUEST['strProviderservice']. "' AND (tblAdspace.strZipcode = '" .$_REQUEST['strZipcode']. "' OR tblAdspace.strTown = '" .$_REQUEST['strTown']. "') AND  tblAdspace.strAd_size = 'Basic' ")
or die(mysql_error());
0
Comment
Question by:pingeyeg
  • 4
  • 3
7 Comments
 
LVL 11

Accepted Solution

by:
elfe69 earned 500 total points
ID: 18756627
First: SELECT TOP 1 * FROM tblAdspace should be replaced by SELECT * FROM tblAdspace (SELECT TOP 1 is not a valid SQL statement)
0
 
LVL 1

Author Comment

by:pingeyeg
ID: 18756642
I don't know, I'm still getting the error.
0
 
LVL 11

Expert Comment

by:elfe69
ID: 18756681
What is the error you get ?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:pingeyeg
ID: 18756740
Parse error: parse error in /Library/WebServer/Documents/providers.php on line 357
0
 
LVL 11

Expert Comment

by:elfe69
ID: 18757459
The error you get is not an SQL error, but a PHP parse error: the code in your PHP page is not correct, look at line 357 in your providers.php file
0
 
LVL 1

Author Comment

by:pingeyeg
ID: 18757644
I don't understand.  Does that mean that maybe I have a quote or double quote wrong or missing?  Is it referring to a syntax error?
0
 
LVL 11

Expert Comment

by:elfe69
ID: 18757714
Yes, you have certainly a syntax error in your PHP code
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now