answerstu

mysqli multi query - Multiple MySql WHERE Between Clauses

Newbie MySql programmer thanks for the patience.Im trying to track an Id number in a table where 3 different conditions are met this is what Iv got however the query dosent return any results where there are clearly matches in the table. Thoughts?SELECT *FROM `table`WHERE `x` BETWEEN 80 AND 20AND `y` BETWEEN 120 AND 20AND `z` BETWEEN 40 AND 10LIMIT 0 , 30Am I right in theory to think that this should work?...Read more

Warning: mysqli_select_db() expects parameter 1 to be mysqli, string given in C:\wamp\www\trynew\down_line.php on line 50

O have gone though the list of similar error and I didn't see the one that works with mine. Am out of time on this job but can still get it. am not an expert yet on php, please I need help on the code below.$db = mysqli_connect("localhost", "joy", "hvkgigkgijhkhi"); if(!$db){ echo "No DB"; }else{ $query = "SELECT * FROM member WHERE uname= '$uname'"; mysqli_select_db("testing",$db); $results = mysqli_query($query); if(!$results){ die('Could not connect: ' . mysqli_connect_error()); }els...Read more

mysqli multi query - MYSQL Select tableX from all databases

Let's say I have 50 databases that all have same schema and all have table 'plays'.Is there any possible way to SELECT all the data from table 'plays' from all the databases at once ?Is there any way to do this if I dont know how many databases I have ?Currently I would do this : (SELECT * FROM db1.plays WHERE condition)UNION(SELECT * FROM db2.plays WHERE condition)UNION...(SELECT * FROM db50.plays WHERE condition) Is there any way to write less code for this ?Regards...Read more