Global Moderator
Internet Junkie
Gender:
Posts: 1523
6847 credits Members referred : 8
Gimme all your cookies!!!
« Reply #21 on: Jan 24, 2006, 08:14:23 PM »
Well, so far I can see that you have the ame problem as the last piece of code. You need to use the same if statement in this one too. But the name is "update" this time.
aka J Love Community Supporter?
Bill Gates is my home boy
Gender:
Posts: 884
1636 credits Members referred : 4
« Reply #24 on: Jan 25, 2006, 02:47:26 AM »
u are looking at wrong page, i am on a different one, link_mod.php:
Code:
<? ob_start(); include("config.php"); if ($logged[username] && $logged[level] >= 2) { // the user is logged in! We continue... if ($_POST['update'] != 'Update') { // the form hasn't been submitted. We continue... $data2 = mysql_query("SELECT * from users where username = '$logged[username]'"); $data2 = mysql_fetch_array($data2); $urlid = $data2[urlid]; $data = mysql_query("SELECT * from links where id = '$urlid'"); $data = mysql_fetch_array($data); // the above lines get the information so that it can be displayed in the html form. echo(" <div align=\"center\"><form method=\"post\"> <table> <tr> <td valign=\"top\">Links Title: </td> <td valign=\"top\"><input name=\"title\" type=\"text\" value=\"$data[title]\"></td> </tr> <tr> <td valign=\"top\">Links URL: </td> <td valign=\"top\"><input name=\"url\" type=\"text\" value=\"$data[url]\"></td> </tr> <tr> <td height=\"85\" valign=\"top\">Description: <br> </td> <td valign=\"top\"><textarea cols=\"30\" rows=\"5\" name=\"description\">$data[description]</textarea> </td> </tr> <tr> <td align=\"center\" colspan=2><input type=\"submit\" name=\"update\" value=\"Update\"></td> </tr> </table> </form> </div>"); } else { $url = $_POST[url]; $title = $_POST[title]; $description = $_POST[description]; // the above lines set variables used below $update = ("UPDATE links set url = '$url', title = '$title', description = '$description' where id = '$urlid'"); mysql_query($update) or die(mysql_error()); // updates the information in the database. echo "Your link has been successfully updated."; } } else { // They aren't logged in! echo "You have either not paid for your link to even submit it, or you are not logged in."; } ?>
aka J Love Community Supporter?
Bill Gates is my home boy
Gender:
Posts: 884
1636 credits Members referred : 4
« Reply #26 on: Jan 25, 2006, 02:55:15 AM »
i htink that query does work because it loads the right link in the form based on what user is logged in, and what URL ID they are assigned manually by me.. it says that it updates teh link but nothing happens
aka J Love Community Supporter?
Bill Gates is my home boy
Gender:
Posts: 884
1636 credits Members referred : 4
« Reply #29 on: Jan 25, 2006, 08:57:25 AM »
ya thats what i thought, that it wasnt correctly updating the right ID #.. any suggestions? i tried addslashes (nik) and still no luck.. but i will leave them there as u say it is better but for what reason im not sure..
aka J Love Community Supporter?
Bill Gates is my home boy
Gender:
Posts: 884
1636 credits Members referred : 4
« Reply #31 on: Jan 25, 2006, 12:08:45 PM »
$urlid as you see comes from a separate table where i pre-define this variable myself.. so how would i go about doing this? i am still learning the basics of php i am v-confused.. i tried creating new $update query = no luck, tried adding it to the current query = no luck..
edit: by the way after you help me figure this one out, i will send u 500 credits for your trouble
« Last Edit: Jan 25, 2006, 12:10:17 PM by Meth0d »
aka J Love Community Supporter?
Bill Gates is my home boy
Gender:
Posts: 884
1636 credits Members referred : 4
« Reply #33 on: Jan 25, 2006, 12:53:23 PM »
yep that fixed it and i should of known that, ill send u the credits now.. wondering if ud still be able to help me if i was to PM you in the future and pay credits each time?