473,385 Members | 1,615 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

You have an error in your SQL syntax check the manual that corresponds to your MySQL

This is my code

Expand|Select|Wrap|Line Numbers
  1. $results = mysql_query("SELECT COUNT(*) as 't_records' FROM `news` domain = '".$domain."' AND menu_name = '".$menu_name."' AND menu_type = '".$menu_type."'") or die(mysql_error());
  2. $total_records = mysql_fetch_assoc($results);
  3. $total_groups = ceil($total_records['t_records']/$items_per_group);
I am getting error from this above code.

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 '= 'isaspainstitute.com' AND menu_name = 'news' AND menu_type = 'news'' at line 1

What was the mistake in my script?
Nov 25 '14 #1

✓ answered by Luuk

It's in the manual.... ;)
http://dev.mysql.com/doc/refman/5.6/en/select.html

It says you need 'WHERE' in your SQL-statement.

1 1854
Luuk
1,047 Expert 1GB
It's in the manual.... ;)
http://dev.mysql.com/doc/refman/5.6/en/select.html

It says you need 'WHERE' in your SQL-statement.
Nov 25 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: beary | last post by:
Could someone please tell me what's wrong with the code below. It worked fine the first time, then I cleared the table (results) and tried it again, but got the message "You have an error in your SQL...
10
by: bobf | last post by:
I am using a program 'My Contact Table' which is a code generator program. It allows you to easily create a PHP/MySQL web application without writing any code. I am trying to create an additional...
1
by: dreamy | last post by:
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 'sum( ) VALUES ()' at line 1 This is my code <?php //make...
9
by: icemaster451 | last post by:
Hello im making a browser game and have 99% working but iv got one error i cant find / fix and would like to know if anyone can help me where im going wrong heres the error QUERY ERROR: You have an...
3
by: qdoet | last post by:
I'm newbie and I had a problem on my SQL syntax like this 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...
1
by: hakitazara | last post by:
i'm using order.php to input the data and I am trying to create an additional data entry page from order.php and name the file as order_process.php When I run the script I get the error message...
4
by: salvador72 | last post by:
INSERT INTO `configuration` VALUES (", 'Logo', 'PDF_INVOICE_IMAGE', 'images/sample_logo.png', ' path and name of the store to insert the logo in PDF format < br > Maximum dimensions 600 x 180 px <...
3
by: Ellenthe | last post by:
Hi. I'm getting the following error over and over: Error: 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 ')'...
1
by: msingh87 | last post by:
Error Code: 1064 - 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 '<br /> <b>Fatal error</b>: Maximum execution...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.