gdebojyoti.mail96
Member
- Messages
- 89
- Reaction score
- 0
- Points
- 6
Hello,
I have created a PHP code for status updates of members of my site.
It's running perfectly in my computer (localhost; WAMP). But it's not working when I am uploading it in my x10hosting account.
The code is as follows:
The problem is that, whenever I am entering a new "Status" in the main.php page, the status ID ( $statid ) is not getting incremented. As a result, whenever I am editing/ deleting a particular status, all the status updates (which have the same status ID) are getting updated/ deleted.
The strange thing is that no such problem arises when I am using the same code in my own computer (localhost; WAMP server).
Can anyone tell me what is wrong?
I have created a PHP code for status updates of members of my site.
It's running perfectly in my computer (localhost; WAMP). But it's not working when I am uploading it in my x10hosting account.
The code is as follows:
Code:
<?php
$pm_ops1 = mysql_connect("localhost","username","password");
$pm_conn1 = mysql_select_db("databaseName");
//Hidden steps to obtain UserID, stored in $userID variable
@$statusCont = htmlentities($_POST["wall"]); //$_POST["wall"] gets the actual contents of the status update from main.php page using POST method
@$statusCont = mysql_real_escape_string($statusCont);
// START updating database
$pm_query1 = "SELECT max(statusID) FROM statusTable";
$result1 = mysql_query($pm_query1);
$output = mysql_fetch_row($result1);
$output[0]++;
$statid = $output[0];
$updateStat = mysql_query("INSERT INTO statusTable (statusID, statup, uid, timestamp) VALUES ('".$statid."', '".$statusCont."', '".$userID."', '".date('ymdHis')."')");
// END updating database
mysql_close($pm_ops1);
header("location:main.php");
?>
The strange thing is that no such problem arises when I am using the same code in my own computer (localhost; WAMP server).
Can anyone tell me what is wrong?