Jump to content

[SOLVED] Is this because of IIS7/Vista or my code


rawky1976

Recommended Posts

Hello

 

This: -

 

<?php

if(isset($_POST['adduser']))

{

include 'config.php';

include 'opendb.php';

 

$firstname = $_POST['firstname'];

$lastname = $_POST['lastname'];

$ext = $_POST['ext'];

$bleep = $_POST['bleep'];

$exttel = $_POST['exttel'];

$email = $_POST['email'];

 

$query = "INSERT INTO users (user_fname, user_sname, user_ext, user_bleep, user_extno, user_email) VALUES ('$firstname', '$lastname', '$ext', '$bleep', '$exttel', '$email')";

 

mysql_query($query) or die('Error, insert query failed');

 

include 'closedb.php';

 

echo "New MySQL user added";

}

?>

 

...always throws the 'die' error and doesn't complete the INSERT. Is it the code or my config?

 

Mark

I think its your code.  Your not giveing it the mySQL connetion details.  You need someting like:

 

$oConn = mysql_connect("dbserver","username","password");

 

Then change

mysql_query($query) or die('Error, insert query failed');

to

mysql_query($query,$oConn) or die('Error, insert query failed');;

 

Hope that helps.

Not really a PHP question but after the INSERT and reload it is not retaining all the CSS, it displays left instead of centered and the menus aren't aligned.

 

I thought it was the echo statement at the end of the function but I removed that and it still does it?

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.