Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You have quoted your table name with single quotes <code>'</code>. If you quote it, do so with backticks. Single quotes are only for string literals in MySQL. This results in a syntax error in your query.</p> <pre><code>$result = mysql_query("SELECT * FROM `" . $table_prefix . "users` where user_regdate = '" . $date . "'"); </code></pre> <p>Next, <code>getdate()</code> in PHP returns an array rather than the date string, which supplies your query with the word <code>Array</code> when passed as a string to the query. Instead, use MySQL's native date functions to get today's date in the format MySQL expects (yyyy-mm-dd):</p> <p><strong>Edit after comments</strong>:</p> <p>Since you have a unix timestamp rather than a date column, create a Unix timestamp of the date:</p> <pre><code>where user_regdate = UNIX_TIMESTAMP(GETDATE()) </code></pre> <p>A little error checking on the <code>mysql_query()</code> call would have revealed the source of the error in the query, and indeed is necessary to prevent your script from failing fatally.</p> <pre><code>$result = mysql_query("SELECT * FROM `" . $table_prefix . "users` where user_regdate = '" . $date . "'"); if (!$result) { // query failed echo mysql_error(); } else { // all is well, proceed with fetch... } </code></pre> <p>Finally, I note that you're collecting the number of rows into <code>$total++</code>. That is unnecessary (unless you are performing some more specific logic we don't see) because the value is available via <code>mysql_num_rows($result)</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload