MySql and php - select all rows

Posted on 2012-09-06
Last Modified: 2012-09-06
Hi E's, I want to know how I select all rows in the table.
Usually I use this with php:
$info_result = mysql_query("SELECT * FROM tablex where id > 0 ", $db); 

Open in new window

That work, but I thing have a more correct way for select all rows in the table.
Can you show me please?

The best regards, JC
Question by:Pedro Chagas
    LVL 21

    Assisted Solution

    I don't think you need "where id > 0"
    Instead of
     SELECT * FROM tablex
    try specifying column names which you need:
     SELECT col1,col2... FROM tablex
    LVL 36

    Accepted Solution

    just try it,

    $info_result = mysql_query("SELECT * FROM tablex ", $db);

    LVL 36

    Assisted Solution

    by:Loganathan Natarajan
    LVL 3

    Author Comment

    by:Pedro Chagas
    Please, don't post more solutions.
    I have to test this ones more later.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Suggested Solutions

    Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
    Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
    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 and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now