php - MySQL I can not write data into the database -
hello guys have problem inserting data in mysql database.i accepted project friend worked.
i make simple php test file , try insert in table _content_city
. query executed bu no records in database column when check in phpmyadmin.
$handler = mysql_connect($server, $user, $pass); $database = mysql_select_db($dbname); if(!$handler) : die("faild connect mysql :" . mysql_error()); endif; if(!$database) : die("db name ". $dbname . " no exists " . mysql_error()); endif; mysql_query("insert _content_grad (wishlist) values('blablabla') ") or die(mysql_error()); printf ("inserterd records: %d\n", mysql_affected_rows());
when execute code in browser have message inserterd records: 1 when check in phpmyadmin data no exist in column. dont know whay.
you guys can see image , u see column wishlist
empty.
http://img710.imageshack.us/img710/1852/5hfw.png
i check foreign_keys , remove foreign_keys , again dont work.
like test make new database name new_test_base , make table albums , column title , test execute php code , data inserted when check in phpmyadmin. problem in database, have full access , privilegies use root (all)
any solution fix this. thanks
the mysql_* range of functions have been depreciated , no longer reccomened use. use mysqli_* range of functions instead.
in code, put following line echo mysql_errno($handler)
, should display latest error retuned mysql, mysqli version of function available.
Comments
Post a Comment