Hello ppl,
I made a script for my site which is using a db to store the data, is an "ad posting" or something like that 🙂 .
Today Y tried first time to upload my script and create my database on my host, i've done everithing, I export the tables from my local db , paste on my host using phpMyadmin . Al tables an data ware sccesfuly created.
but when I try to acces my page I recive this message:
Warning: Supplied argument is not a valid MySQL result resource in /hsphere/local/home/sibiul/sibiul.ro/angajari.php on line 48
This is the php file where the error is, but the error apears only online, when I try my page at home it works perfectly.
<?
require ("db.inc.php");
//sterge ce este mai vechi de o saptamana
$current_timestamp = time();
$limit_timestamp = $current_timestamp - (7 * 60 * 60 * 24);
mysql_query('DELETE FROM anunturi_angajari where timestamp < '. $limit_timestamp);
//citeste din tabel toate valorile
$result = mysql_query ("SELECT * FROM anunturi_angajari order by timestamp desc");
while ($data = mysql_fetch_array ($result))//THIS IS LINE 48!!!!!!!!!
{
?>
<table class="button" cellspacing="0" cellpadding="0" width="415" border="0">
<tr><td class="buttonleft" align="left"><b> <? echo $data["title"]; ?></b> </td><td align="right" class="buttonright"><b>[<? echo date("d. m. Y", $data["timestamp"]) ?>]</b></td></tr>
<tr><td class="linksmall" rowspan="5" width="245" align="justify"><? echo nl2br($data["descriere"]) ?></td></tr>
<tr><td class="linksmall" width="170"><b>Nume:</b> <? echo $data["nume"]; ?> </td></tr>
<tr><td class="linksmall" width="170"><b>Telefon :</b> <? echo $data["tel"]; ?></td></tr>
<tr><td class="linksmall" width="170"><b>Email:</b> <a class="underscore" href="contact.php?dest=<? echo nl2br($data["email"]) ?>&id=<? echo nl2br($data["id"]) ?>&categorie=calculatoare"><? echo nl2br($data["email"]) ?></a></td></tr>
<tr><td class="linksmall" width="170"><b>Website :</b> <? echo nl2br($data["site"]) ?></td></tr>
<?
}
?>
Can U tell me what can be, why is this page generating an error ? U can see the page here :
http://www.sibiul.ro/angajari.php
10x and see ya