Solved

SQl statements getting parse errors

Posted on 2007-03-20
7
212 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

759 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

19 Experts available now in Live!

Get 1:1 Help Now