Code: Select all
$sql = 'SELECT * FROM `database` WHERE `table1` & lt ; = current_dateModerator: General Moderators
Code: Select all
$sql = 'SELECT * FROM `database` WHERE `table1` & lt ; = current_dateCode: Select all
$sql = 'SELECT * FROM `database` WHERE `table1` AND lt = NOW()';First of all, you select FROM a table, not a database (you first specify the database with:influenceuk wrote:I have been trying to enter this mySQL query into my PHP page but keep getting errorsHow would i go about putting it in?Code: Select all
$sql = 'SELECT * FROM `database` WHERE `table1` & lt ; = current_date
Code: Select all
mysql_select_db(`databasename`);Code: Select all
$sql = 'SELECT * FROM `table1` WHERE `date-in-record` < DATE()';Hmm... what the heck? I guess I was confused by your query + read/replied too fast. Forgive me, and ignore my previous postOren wrote:Code: Select all
$sql = 'SELECT * FROM `database` WHERE `table1` AND lt = NOW()';
Yeah sorry i posted database instead of table by mistake.califdon wrote:First of all, you select FROM a table, not a database (you first specify the database with:influenceuk wrote:I have been trying to enter this mySQL query into my PHP page but keep getting errorsHow would i go about putting it in?Code: Select all
$sql = 'SELECT * FROM `database` WHERE `table1` & lt ; = current_datethen you specify the selection criteria in the WHERE clause. I don't know what you're actually trying to do, but I suspect you want something like:Code: Select all
mysql_select_db(`databasename`);Code: Select all
$sql = 'SELECT * FROM `table1` WHERE `date-in-record` < DATE()';
Code: Select all
mysql_select_db(`databasename`);
$sql = 'SELECT * FROM `cdsus` WHERE `release` > DATE()';
$sql = 'SELECT * FROM `cdsuk` WHERE `release` > DATE()';Aside from the other comments; you have no closing quote in that statement, and what errors are you getting? Please be specific when posting. Not only is that invalid SQL, it's not even valid PHP.influenceuk wrote:I have been trying to enter this mySQL query into my PHP page but keep getting errors
How would i go about putting it in?Code: Select all
$sql = 'SELECT * FROM `database` WHERE `table1` & lt ; = current_date
Why do you need multiple connections? Is your data located on two different servers? Two seperate databases? Or just two (or more) tables in the same database on the same server?influenceuk wrote: so if i state the database connection atthe top, and or to the connections.php file (where the database info is held) can i then just have multiple DB conections?
exampleso in theory the above would allow me to display data from the database, but have 2 different tables showing info?Code: Select all
mysql_select_db(`databasename`); $sql = 'SELECT * FROM `cdsus` WHERE `release` > DATE()'; $sql = 'SELECT * FROM `cdsuk` WHERE `release` > DATE()';