Jump to content

vnichol

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Everything posted by vnichol

  1. I think that the code is mostly correct, but it passes through and says that it updated the field, but actually it is not adding any information to the table. My logic may be off, I am really not sure. Any help would be appreciated. Thanks include("include/session.php"); $temp =$session->username; // variable that holds user who is logged in. $result = mysql_query("SELECT * FROM profile WHERE 'username'='$temp'"); // username is table col with information if(mysql_num_rows($result)!==0) { $sql="INSERT INTO profile (username, fname, lname, age, city, occupation) VALUES ('$_POST[username]','$_POST[fname]','$_POST[lname]','$_POST[age]','$_POST[city]','$_POST[occupation]')"; echo "1 record added!";} else { $sqlUserExists="update profile set fname = $_POST[fname], lname = $_POST[lname], Age = $_POST[age], city = $_POST[city], occupation = $_POST[occupation] where username = $_POST[‘username’]"; echo "Profile Updated!"; } ?>
  2. Thank you all for the help, it was the includes and a , that ended up being the problem. Again thanks for the help. vincent.
  3. this is still not working, but I am guessing that as well as the phrase error, there must be errors created by the includes <? include("include/session.php"); // keeps track of login include('include/headder_login.php'); ?>// gives page menu because the form doesn't even seem to get to the protimes page which should do the processing of the post data. If you have any other ideas thank you very much, if not I will keep looking.... again thanks for the help. vincent.
  4. I know this is very simple, but... Any way here is the code for my form, but it doesn't post to my database and there are no errors shown. Any ideas? thanks <? include("include/session.php");?> <? include('include/headder_login.php'); ?> <h1>Event Information : <? echo $session->username; ?></h1> <form> <form action="protimes.php" method="post" name="event information"> <input name="id" type="text" value=""> <input name="name" type="number" value="name" size="30"> <select name="event"> <option value="1">50 Front</option> <option value="2">50 Back</option> <option value="3">100 Front</option> </select> <input name="time" type="time" value"time" > <input name="date" type="date" value="date"> <input name="submit" type="button" value="submit" align="right"> <input type="reset" name="reset" value="reset"aligh="right"> </form> protimes.php file $sql="INSERT INTO `cbcrusta_test3`.`info` ( `id` , `name` , `event` , `time` , `date` ) VALUES ('$_POST[id]','$_POST[name]','$_POST[event]','$_POST[time]','$_POST[date')"; if (!mysql_query($sql)) { die('Error: ' . mysql_error()); } echo "1 record added";
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.