-
more than certain number
Hi guys
if i wanted to show all listings with more than 5 applications how would i do it
I have this if i want to show all records with 0 applications
PHP Code:
$sql = ("select * from jobs WHERE applications='0'");
I guess it would be something similar?
-
simple operators
> greater than
< less than
= equal to
!= not equal to
Code:
(select * from jobs where applications >= 5);
-
thank you
how about rows that have been added in the last 24 hours?
what would be the logic?
-
heres a snippet for the last 7 days. should be easy to alter ;)
PHP Code:
<?php
$now = time(); // this is the current UNIX timestamp for the server
$days = 7; // change to number of days
$days_ago = date("Y-m-d H:i:s", ($now - (86400 * $days));
$query = "SELECT username FROM users WHERE lastvisited > '$days_ago'";
$result = @mysql_query($query);
if(@mysql_num_rows($result)) {
while($row = mysql_fetch_row($result)) {
print "$row[0] <br />";
}
}
?>
-
Quote:
Originally Posted by
spikeZ
!= not equal to
<> not equal to, sql standard