i ended up making another table (settings) and it's working fine, thanks for your help.
but i have a totally different question now.
the links script im making (
http://www.404-design.net/links.php or
http://www.404-design.net/linkadmin.php with password 4985) has the user add their link, and when they do, it adds it to the db with 2 values.
con(confirmed) = 0
and new = 1;
when i delete, it changes new to 0, and if you click approve, it changes con to 1.
only links with new = 1 and con = 1 are displayed on the links page
on the admin page, only links with new = 1 are (whether its confirmed or not, it gets displayed). Might be easier if you take a look at the links i provided.
now i thought that it would be a waste to keep all the links in the DB before, but I couldnt find a way to delete them without the script messing up.. so either i find a way to delete them and run the script fine, or it'll be a waste of db space (especially if over 100+ people try to submit their links)
it wouldnt be too bad, but it saves EVERY link submitted, whether it's approved or not.
this is the part of code that gets the stuff:
Code: Select all
$rowsql = "SELECT * FROM `$table`";
$result = mysql_query($rowsql);
$rows = mysql_num_rows($result);
$i = 0;
while($i<$rows){
$i++;
$csql = "SELECT `con` FROM `$table` WHERE `id` = '$i' LIMIT 1";
$n2sql = "SELECT `con` FROM `$table` WHERE `id` = '$i' LIMIT 1";
$lsql = "SELECT `link` FROM `$table` WHERE `id` = '$i' LIMIT 1";
$nsql = "SELECT `name` FROM `$table` WHERE `id` = '$i' LIMIT 1";
$dsql = "SELECT `description` FROM `$table` WHERE `id` = '$i' LIMIT 1";
$con = mysql_result(mysql_query($csql), 0,0);
$new = mysql_result(mysql_query($n2sql), 0,0);
$link = mysql_result(mysql_query($lsql), 0,0);
$name = mysql_result(mysql_query($nsql), 0,0);
$description = mysql_result(mysql_query($dsql), 0,0);
if($con=="1" && $new=="1"){
echo <<<EOT
<a href="$link">$name</a><br>
$description<br><br>
EOT;
}
}
now when i delete one of the links that wasnt approved (ie. someone screwing with the script or submitting a site that the webmaster didnt want on it (pr0n, warez, etc..), then it gives me this:
Code: Select all
Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 35 in /home/des404/public_html/links.php on line 38
Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 36 in /home/des404/public_html/links.php on line 39
Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 37 in /home/des404/public_html/links.php on line 40
Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 38 in /home/des404/public_html/links.php on line 41
Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 39 in /home/des404/public_html/links.php on line 42