|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-06-30 04:46 UTC] Akujin11 at yahoo dot com
I'll start with the code that is the source of the problem:
function submit_values($char_name, $str, $spe, $skill, $def, $pow) {
$submittal = "INSERT INTO stats (name, strength, speed, skill, defense, power)
VALUES ('$char_name', $str, $spe, $skill, $def, $pow);";
$submittal_q = mysql_query($submittal) or
die(mysql_error());
echo "Added $char_name, $str, $spe, $skill, $def, $pow";
}
now that the code is stated, i'll give the problem, and it is a simple one: this code does nothing. it is the same exact code i was using successfully before upgrading to 4.2.0, however now it does absolutly nothing. the code processes, acts as if nothing is wrong, however when executed absolutly no information is being added to my database.
i request that you NOT simply say "consult the users manual" like you have to so many other people, because it solves nothing. i would like a REAL solution to this problem.
-The Akujin.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 14:00:01 2025 UTC |
thats the POINT. it doesn't work right. it can call data from my database (so i know the connection works) but it refuses to insert anything. the source is as follows: <html> <head> <title>Character Entry Form</title> </head> <body> <?php mysql_connect("localhost", "root") or die("Could not establish a connection to the database."); mysql_select_db("MvC2") or die("Could not select the given database."); function submit_values($char_name, $char_game, $char_alias) { $insert_query = "INSERT INTO characters VALUES ('$char_name', '$char_game', '$char_alias');"; mysql_query($insert_query) or die(mysql_error()); } function results() { ?> <table width=400 border=1> <tr> <td width=150>Name</td> <td width=50>Game</td> <td width=150>Alias</td> </tr> <? $result_query = "SELECT * FROM characters ORDER BY name;"; $result_value = mysql_query($result_query) or die(mysql_error()); $x = 0; while ($row = mysql_fetch_array($result_value)) { if(($x % 2) == 0) { $c = "#cccccc"; } else { $c = "#FFcccc"; } ?> <tr> <td bgcolor="<?= $c; ?>"><?= $row["name"]; ?></td> <td bgcolor="<?= $c; ?>"><?= $row["game"]; ?></td> <td bgcolor="<?= $c; ?>"><?= $row["c_alias"]; ?></td> </tr> <? $x++; } ?> </table> <? } function show_input() { ?> <form method=post action="<?php $PHP_SELF ?>"> <table width=400 rules="none"> <tr> <td>Name:</td> <td><input type="text" name="character"> </tr> <tr> <td>Game:</td> <td><input type="text" name="game"> </tr> <tr> <td>Alias:</td> <td><input type="text" name="alias"> </tr> <tr> <td><input type="submit" name="submit" value="insert character"></td> <td><input type="reset" value="reset"></td> </tr> </table> </form> <? } if ($submit) { $insert_query = "INSERT INTO characters VALUES ('Akuma', 'game', 'alias');"; mysql_query($insert_query) or die(mysql_error()); show_input(); results(); } else { show_input(); results(); } ?> </body> </html> see what you can make of it, but i'm telling you the problem lies not with the code (which i personally wrote, and that worked untill my upgrade), but insted with the new release. if you look at the number of people that are having this same problem you will see that the evidence does point that way.