[nflug] PHP Coding..
Tony E - Jaraeth
jaraeth at phoenixwing.com
Sun Oct 5 21:19:21 EDT 2008
To get a better idea of what could be wrong try changing your die
message from:
mysql_query($query) or die('<BR><BR><BOLD>Error, insert query
failed!,</BOLD>');
To something like:
mysql_query($query) or die("<br><br><b>Error No#".mysql_errno().":
".mysql_error()."</b><br>\n");
That should help you figure out at which point it fails. Cut & paste
that error back here and we can go from there if needed.
HTH,
Tony E
"Raptus regaliter"
jaraeth at phoenixwing.com
http://www.phoenixwing.com/
robert at muzzlethem.com wrote:
> Hi all! Trying my hand at MySQL and PHP coding. Given the following code:
>
> <?php
> include 'lib/config.php';
> include 'lib/opendb.php';
>
> $browser = $_SERVER['HTTP_USER_AGENT'];
> $ip = $_SERVER['REMOTE_ADDR'];
>
> echo $browser;
> echo '<BR>',$ip;
>
> mysql_select_db($dbname);
>
> $query = "INSERT INTO banking (IP, BROWSER, UserName, PassWord) VALUES
> ($ip,
> $browser, 'DummyUser', 'DummyPass')";
>
> mysql_query($query) or die('<BR><BR><BOLD>Error, insert query
> failed!,</BOLD>');
>
> include 'lib/closedb.php';
>
> I keep getting the message saying that the insert query failed. Is there
> something that I am doing wrong here?
>
> _______________________________________________
> nflug mailing list
> nflug at nflug.org
> http://www.nflug.org/mailman/listinfo/nflug
>
>
>
More information about the nflug
mailing list