astrodestino
IS-IT--Management
Hi!
I got mys site which is running ok at my localhost.
I upload it and when I want to access it will return:
SELECT * FROM horoscopo where dia=09 and mes=12 and ano=2005 order by id asc limit 0,30 query failed.
The database, username and password are ok cause if I change anyone os those I will get username or password error.
I go to phpmyadmin and I copy & pasto the sql syntax and it will return all the results.
Here is my code:
Its strange, in phpmyadmin (online) and in my localhost I got no problems, my problems are online
How can this be fixed?
Tnx!
I got mys site which is running ok at my localhost.
I upload it and when I want to access it will return:
SELECT * FROM horoscopo where dia=09 and mes=12 and ano=2005 order by id asc limit 0,30 query failed.
The database, username and password are ok cause if I change anyone os those I will get username or password error.
I go to phpmyadmin and I copy & pasto the sql syntax and it will return all the results.
Here is my code:
Code:
function stamp2date($stamp){ // expects a valid timestamp
return date("m.d.Y", $stamp); // returns 19.11.2005
}
$hoy = mktime(0, 0, 0, date("m") , date("d"), date("Y"));
list($month, $day, $year) = split('[/.-]', stamp2date($hoy));
$sqlstm="SELECT * FROM horoscopo where dia=".$day." and mes=".$month." and ano=".$year."
order by id asc limit 0,30";
$link = mysql_connect('localhost', 'username', 'pass') or die("Could not
connect1");
mysql_select_db('mydb', $link);// or die("Could not select".'adhoro');
$result = mysql_query($sqlstm, $link) or die("Query failed1".$sqlstm);
Its strange, in phpmyadmin (online) and in my localhost I got no problems, my problems are online
How can this be fixed?
Tnx!