aHMAD_SQaLli Posted August 6, 2015 Share Posted August 6, 2015 Hello every one so, I've been using mysql for almost 2years and I've heard that using MySQLi is more secure and I m still new in the prepared statement thing that's why I was wandering how to do this prepared statement with arrays ?? in an example I have this code, how can I execute it with prepared statement ? $sql = mysqli_query($con, "SELECT users.regdate, topics.topic_body FROM `users` LEFT JOIN topics ON topics.topic_author = users.id WHERE topics.id=1 order by topic_edit_time ASC"); if( mysqli_num_rows($sql)>0 ) { while($row = mysqli_fetch_array($sql)) { echo htmlentities($row['regdate']) . "<br>" ; echo htmlentities($row['topic_body']); } } else { echo 'not found'; } Thanks Quote Link to comment Share on other sites More sharing options...
aHMAD_SQaLli Posted August 7, 2015 Author Share Posted August 7, 2015 NO HELP ??? !!! ... Quote Link to comment Share on other sites More sharing options...
Solution NomadicJosh Posted August 7, 2015 Solution Share Posted August 7, 2015 I think what you need is mysqli_stmt_fetch, and you should also take a look at mysqli_prepare. Those two resources should help steer you into the right direction. Quote Link to comment Share on other sites More sharing options...
Barand Posted August 7, 2015 Share Posted August 7, 2015 NO HELP ??? !!! ... Apologies for not being online when you posted. Had I known you were in such a hurry I would have sat in front of my screen all day just waiting for you to post a problem. 1 Quote Link to comment Share on other sites More sharing options...
racken Posted August 8, 2015 Share Posted August 8, 2015 use mysqli prepare and fetch http://php.net/manual/en/mysqli.quickstart.prepared-statements.php Quote Link to comment Share on other sites More sharing options...
aHMAD_SQaLli Posted August 8, 2015 Author Share Posted August 8, 2015 I think what you need is mysqli_stmt_fetch, and you should also take a look at mysqli_prepare. Those two resources should help steer you into the right direction. thanks, it's perfect ! Quote Link to comment Share on other sites More sharing options...
Destramic Posted August 10, 2015 Share Posted August 10, 2015 Apologies for not being online when you posted. Had I known you were in such a hurry I would have sat in front of my screen all day just waiting for you to post a problem. Brilliant! Haha Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.