i m using mysql with php. i had a script that take some informaion from database table and show it on html page.
problem is that this script run properly on my local machin with apache web server and windows environmet, but when i upload this on my site it shows the following error,
"Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/itpromot/public_html/itpromoters/forum/functions.php on line 11".
and source code of the page(functions.php)is as taht i wrote,
"
<?php
$connection = mysql_connect("localhost", "user", "pwd") or die("connection failed");
mysql_select_db("exampledb",$connection) or die("not connect to database");
function topic_display()
{
global $counter;
if(!$counter || $counter<0) $counter=0;
$topic_query = mysql_query("select * from forum_messages where MY_PARENT=0 order by ID limit $counter,50", $connection) or die("not execute query oeyeoooooooe");
while($topic = mysql_fetch_array($topic_query))
{
?>
<font style="font-family: Verdana; font-size: 8pt"><A HREF="topic_threads.php?postID=<?php echo($topic['ID']) ?>&parentid=0"><?php print(htmlspecialchars(stripslashes($topic['TOPIC']))) ?></a>
<BR> Added on <?php print(date("l, F j Y", $topic['TIMESTAMP'])) ?> by <A HREF="mailto:<?php print(htmlspecialchars(stripslashes($topic['EMAIL']))) ?>"><?php print(htmlspecialchars(stripslashes($topic['NAME']))) ?></A>
</font><BR>
<HR WIDTH=80% ALIGN="center">
<?php }
if (mysql_num_rows($topic_query) < 1)
{
$counter -= 50;
?>
<DIV ALIGN="center"><BR><B><font face="Verdana" size="3">There Are No Topics</font></B><BR><BR></DIV>
<?php }
print("<BR><CENTER><font face='Verdana' size='1'><A HREF=" . $PHP_SELF . "?counter=" . ($counter -= 50) . ">Previous 50</A> | ");
print("<A HREF=" . $PHP_SELF . "?counter=" . ($counter += 100) . ">Next 50</A></font></CENTER>");
}
"