Skip to content

Tag: mysql

MySQL SELECT in order of array values

Can anyone help me with a Query query? I have an array of IDs $IDvalues = array(“128”, “159”, “7”, “81”, “82”, “83”); And need to retrieve data from another table in the order of the array. At the moment, I have this query: But it’s…

Security for websites

I am trying to add some security to my website which has an admin panel and a user page. So far my security has code which sends the user back to the login page if the user tries to access a page through the url. However, there is still one problem that remains. If I login as a user, the

Counting specific rows after dynamical WHERE clause query in PDO

I’m following this tutorial for a dynamical WHERE clause query in PDO. Let’s suppose I have a short version of the tutorial code, just like this: By adding the line $count = $stmt->rowCount();, I could count the rows. Now let’s suppose I have data like this: If I searched for “Smith…