Jump to content

PHP/MySQL Help


Lukeidiot

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.