#1
| |||
| |||
Mysql problem Hi I have problem in my mysql database. I have posted my code below. Please check below Code: global $mys; $st = $mys->prepare('SELECT user_name from `user_details` where user_email = ?'); $st->bind_param('s', $var); $st->execute() or $this->myerror[] = $st->error; echo $st->affected_rows; |
#2
| |||
| |||
Re: Mysql problem Hi Surely there is any error in your code. I am not sure how you script works, but I think you should try to print out the $this->myerror array and see if there are any errors in your script and verify what the error was. Besides this I think that sql look fine, that is rest of the program look fine to me. Try the above command and then post back if you have any more problems.
__________________ Grand Theft Auto 4 PC Video Game |
#3
| |||
| |||
Re: Mysql problem Hello you can try the above, optionally even you can try the following part of code Code: mysqli_stmt->affected_rows does this - If you like to use the select query, you can use the following Code: $st->num_rows |
#4
| |||
| |||
Re: Mysql problem Hi I think i should start to learn mysql thoroughly now. Even i do not have much experience in mysql. I have decided to start learning mysql thoroughly. Some time you know most of the things, but one simple wrong function spoils the whole code. If you do not learn mysql thoroughly, no use to use the mysql as a database.
__________________ Grand Theft Auto 4 PC Video Game |
#5
| |||
| |||
Re: Mysql problem Hi This is my modified code, please check. I am not sure this is the way of correct programming. Please check and advice me for the same. Code: <?php $mys = new mys("localhost","",,""); if(mys_connect_errno() > 0) { printf("detail: %s.\n", mys_connect_error()); exit(); } $mys->autocommit(0); global $mys; ?> |
#6
| |||
| |||
Re: Mysql problem Hi I think you are using the prepared statements, it would be better if you use Code: mysqli->affected_rows mysqli->affected_rows $stmt->affected_rows |
![]() |
|
Tags: database, mysql, php, scripting language |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
MySQL 9.04 to 9.10 problem | Flacos | Operating Systems | 5 | 24-04-2010 05:31 AM |
php/mysql select problem | Fragman | Software Development | 3 | 30-11-2009 02:52 PM |
Mysql Error : Can't connect to local mysql server through socket ' var lib mysql mysql.sock' 2 | roshan45 | Software Development | 3 | 07-11-2009 09:36 PM |
Problem connecting to mysql db | Wagan-rave | Software Development | 3 | 21-03-2009 10:57 AM |
problem with php / mysql under ubuntu | T TelDa | Networking & Security | 3 | 01-11-2008 01:37 PM |