Php programming connection to the database to read data tables

Source: Internet
Author: User
Php programming connection to the database to read data tables problem my database has multiple data tables, only the table order cannot read can only print 111
Any other table can print 222
I don't know what's wrong with QAQ
   
              

Shopping cart No.: $ row [cartNo] Customer No.: $ row [cusNo] product No.: $ row [proNo] purchase date: $ row [cartDate] purchase amount: $ row [cartSum] shipping address: $ row [cartAddress]


"; Echo"

";?>


Reply to discussion (solution)

The easiest part here is to display order records at the end !!!! The order table cannot be read !!!! Please help me !!! I really don't have any questions. QAQ
Below are my data tables and databases

$ Query = mysql_query ("select * from order ");
Order is ?? Word
Change
$ Query = mysql_query ("select * from 'Order "');
You can.

Which? Do not use table names ?? Word ratio? Okay. Can I use orders? .

$query=mysql_query("select * from `order` ");

I know that the table name cannot use keywords.
However, if you have a keyword, you must use.

Only the table order cannot be read. only 111 rows can be printed.
Any other table can print 222. In fact, you already know the problem from your description, that is, the order table problem. what is the problem? like the keyword order, so change the table name or 'order'

$ Query = mysql_query ("select * from order") or die (mysql_error ());
I don't know what the prompt is.

Mysql reserved word http://www.cnblogs.com/lawdong/archive/2010/08/08/2357903.html
Do not escape any reserved words when they are used as other words: enclose them''
The following reserved words can be used as exceptions:
ACTION
BIT
DATE
ENUM
NO
TEXT
TIME
TIMESTAMP

It turned out to be a keyword issue. thank you all. I know it has been changed ~~~~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.