Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Closed Thread
A problem with Sql statement in PHP
Old 05-22-2010, 11:45 PM A problem with Sql statement in PHP
Novice Talker

Posts: 5
Name: Bilal Tahir
Trades: 0
my code is
if(isset($_POST['signup']) ){
$sea = $_REQUEST['search'];

if($_REQUEST['area'] == "text"){
$sql = "SELECT * FROM `refrences` WHERE `refText` LIKE '%$sea%' ";
$abc = mysql_query($sql);
}else if($_REQUEST['area'] == "book"){
$sql = "SELECT * FROM `refrences` WHERE `bookPage` LIKE '%$sea%' ";
$abc = mysql_query($sql);
}else{
$sql = "SELECT * FROM `refrences` WHERE cond != """;
$abc = mysql_query($sql);
}
if(isset($_GET['DEL']) && $_GET['DEL']=="yes" && isset($_GET['uid']) && $_GET['uid'] > 0){
$sqlDel = "DELETE FROM refrences WHERE no ='$_GET[uid]'";
$resDel = mysql_query($sqlDel);

header("Location: search.php?msg=Information deleted successfully.");
exit;
}

and the error is in the bolded line syntax error, unexpected T_STRING. When I write the same query in MySql it works efficiently but in my PHP file it shows the error
cbtahir2001 is offline
View Public Profile
 
 
Register now for full access!
Old 05-23-2010, 12:50 AM Re: A problem with Sql statement in PHP
Novice Talker

Posts: 5
Name: Bilal Tahir
Trades: 0
fortunately I have found the reply. the problem was with double quotes in the query. I had to use WHERE cond!=' ', while I had been using WHERE cond!=" ". So Now the matter is resolved
cbtahir2001 is offline
View Public Profile
 
Closed Thread     « Reply to A problem with Sql statement in PHP
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09586 seconds with 12 queries