Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

SQl statements getting parse errors

Posted on 2007-03-20
7
216 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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 …

809 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