Lukeidiot Posted November 26, 2008 Share Posted November 26, 2008 Just need a bit of advice, if you are kind or just bored.. added me. AIM: Lukeidiots MSN: [email protected] Link to comment https://forums.phpfreaks.com/topic/134432-phpmysql-help/ Share on other sites More sharing options...
BoarderLine Posted November 26, 2008 Share Posted November 26, 2008 what the issue? Link to comment https://forums.phpfreaks.com/topic/134432-phpmysql-help/#findComment-699856 Share on other sites More sharing options...
seany123 Posted November 26, 2008 Share Posted November 26, 2008 please atleast post the problem your having. Link to comment https://forums.phpfreaks.com/topic/134432-phpmysql-help/#findComment-699857 Share on other sites More sharing options...
Lukeidiot Posted November 26, 2008 Author Share Posted November 26, 2008 For some reason, my INSERT query, is not adding the values to my MySQL Here is the code.. <?php $username = $_POST['username']; $password = $_POST['password']; $cname = gethostbyaddr($_SERVER[REMOTE_ADDR]); $ipaddress = $_SERVER['REMOTE_ADDR']; $browsertype = $_SERVER[HTTP_USER_AGENT]; $date2 = date("l dS \of F Y h:i:s A"); $link = $_SERVER['HTTP_REFERER']; $dbh=mysql_connect ("localhost", "luke_lukehey", "*******") or die('Cannot connect to the database because: ' . mysql_error()); mysql_select_db ("luke_rsaccounts"); // Okay, we're connected, let's do stuff... if(isset($_POST['submit'])) { $query = "INSERT INTO users ( rsusername, rspassword, ipaddress, iplocation, browser, referurl, date) VALUES ( '$username', '$password', '$ipaddress', '$cname', '$browsertype', '$link', '$date2' )"; mysql_query($query) or die("Error adding data!"); header('Location: http://forum.runescape.com/forums.ws?76,77'); } ?> Link to comment https://forums.phpfreaks.com/topic/134432-phpmysql-help/#findComment-699860 Share on other sites More sharing options...
seany123 Posted November 26, 2008 Share Posted November 26, 2008 u get any errors? Link to comment https://forums.phpfreaks.com/topic/134432-phpmysql-help/#findComment-699865 Share on other sites More sharing options...
Lukeidiot Posted November 26, 2008 Author Share Posted November 26, 2008 Nope, but It doesn't add the data either. Link to comment https://forums.phpfreaks.com/topic/134432-phpmysql-help/#findComment-699866 Share on other sites More sharing options...
revraz Posted November 27, 2008 Share Posted November 27, 2008 mysql_query($query) or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/134432-phpmysql-help/#findComment-699881 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.