Hello I've been working on my webpage adding some PHP here and there. Now I have a problem with adding somthing to one of my MySQL databases. But I can't figure it out it works some times and then it doesnt work.
$sql="INSERT INTO News VALUES ("
."'$date $time', "
."'$txtTitle', "
."'$txtBody', "
."'$txtAuthor')";
$hStmt = mysql_query($sql,$hCon);
if(!$hStmt) {
echo "Query Failuer for Inserting News Topic!";
}
It use to be hStmt2 as the variable but it didnt work so I changed it too hStmt3 and it worked then when I tried it again it didnt work. Ohh and before this problem it worked at hStmt and then I needed to change it to hStmt2 and that worked for a while. Every time I change the var name it works but only one time and since I dont want to have a var name hStmt901828750 could some one figure out what the problem is.
If you need more of my webpage code I will give it all except the confadential stuff. I know this is not a PHP forum but .... Byond is my comunity.
ID:275627
Jul 5 2004, 12:20 pm
|
|
How did you setup your MySQL database? It sounds like you're having problem validating userId/PW/dataName, how are you passing theses along to access the database? From looking at your code it appears fine, unless other parts of your PHP are using those same variables? $hStmt is just a variable that passes along the information to add into the MySQL query. That shouldn't really effect anything.
The best place for PHP help is the source of PHP itself. http://www.php.net Cheers! LJR |
I recently discovered it, and am very pleased.