Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
| Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 6th, 2006, 07:33 AM
Authorized User
 
Join Date: Oct 2004
Location: Bangalore, Karnataka, India.
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default php and mysql query

Hai

     In my application I am using one query like this

$qry_count ="SELECT COUNT(*) FROM tbl_mail LEFT JOIN tbl_country ON tbl_mail.country_id = tbl_country.country_id WHERE tbl_mail.deleted_status <> 'Y' AND tbl_mail.first_name LIKE '%x%'";

     This query work fine in my php application and mysqladmin.

     But if I tried using

$qry_count ="SELECT COUNT(*) FROM tbl_mail LEFT JOIN tbl_country ON tbl_mail.country_id = tbl_country.country_id WHERE tbl_mail.deleted_status <> 'Y' AND tbl_mail.first_name LIKE '%xxxxxx%'";

      Here I am getting following error in php but it work fine in Mysqladmin.

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


Any body have idea on this

Thanks!:)



 
Old February 12th, 2006, 06:43 PM
Friend of Wrox
 
Join Date: Dec 2004
Location: London, London, United Kingdom.
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have copy the line:

$qry_count ="SELECT COUNT(*) FROM tbl_mail LEFT JOIN tbl_country ON tbl_mail.country_id = tbl_country.country_id WHERE tbl_mail.deleted_status <> 'Y' AND tbl_mail.first_name LIKE '%xxxxxx%'";

and put it into a php file and run it in IE:
>> i'm not getting any error msg.




Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Query Problem w/ PHP rdmapes PHP How-To 5 August 14th, 2010 12:55 AM
php/mysql delete button and delete query dungey PHP Databases 17 April 11th, 2009 12:24 PM
PHP and MySQL MiNdWaRp PHP How-To 0 May 14th, 2007 06:25 PM
MySQL/PHP Help blackout Beginning PHP 1 August 8th, 2006 07:49 AM
begin php & mysql - chapter 12, user_form.php jon_stubber Beginning PHP 1 March 9th, 2006 10:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.