I can't take data out of database

+1 vincent van Duijnhoven · July 16, 2014
I am trying to connect to a database.
the connect part went without any problems but when i try to take data out of the database it doesn't work.

this is the code

<?php
    require 'connect.inc.php';

    $query = "SELECT * FROM `users` ";

    if ($query_run = mysql_query($query)){
        echo 'Query succes';
    }else{
        echo mysql_error();
    }
?>

Post a Reply

Replies

- page 2
Oldest  Newest  Rating
+1 Alan Johnson · July 16, 2014

  1. Are you sure connecting is working?

  2. Are you sure you have a table called users?



If the answer to those is yes, post the error you are getting.

Also, you should look at using PDO or mysqli instead of the mysql_* functions.
  • 1
  • 2

PHP

107,335 followers
About

Server-side, HTML embedded scripting language used to create dynamic Web pages.

Links
Moderators