Dear Liang. if you don't post the code you're using, how do you expect us to know what's wrong? Posting a link to somebody else's code is not the same thing. What errors do you get?
Perhaps this would be useful? although it deals with PHP, it is relevant to … Read More
You are using deprecated code (mysql functions) - see my tutorial for alternatives: [DW Tutorial: Common Issues with MySQL and PHP](https://www.daniweb.com/programming/web-development/threads/499320/common-issues-with-mysql-and-php) .
Also, get the file extension using `pathinfo()` not the DIY method. Read More
$ext = pathinfo($filename, PATHINFO_EXTENSION);
PDO is really easy - the hardest part is remembering the conenction string!
$pdo = new PDO("mysql:host=localhost,dbname=mydb","root","password");
$stmt = $pdo->prepare(Insert into tbl_user (user_id, ap_id, big, small, big1, small1, big2, small2) VALUES (?,?,?,?,?,?,?,?));
Done. No need for any escaping / sanitizing. Read More
I'd probably do something like this, in order to keep it flexible. I'd most likely create a class though.
$allowedExtensions = ['png','jpg','jpeg','gif'];
$key = 'myimage';
$setWidths = [600, 130];
$uploadDirectory = ['upload/','upload/'];
$prefix = ['','small_'];
$quality = [100,100];
$fieldListArray = ['big','small','big1','small1','big2','small2'];
$newFilenames = … Read More
Make sure this:
$pdo = new PDO("mysql:host=localhost;dbname=dwtest","root","mypassword");
Has your correct connection details. Don't think that should bive an ISE though. If you're using a framework though, stupid things can trigger ISEs for no good reason that I can think of. It all worked fine for me other than the write … Read More