- >> Date is the current date
>> Picks each of these types only once: question, answer
>> Picks only the last of each type. (EXAMPLE: if i have 2 questions for the same data it picks the latest one (I have an id next to each row))
Thank you.
Moderator: General Moderators
And I only want the question on 31 and matching answer which is 32It goes id, info, data, type:
29 ......Af80KGD8fGux07VmkxwYXQxn..... June 19, 2006.... question
30 ......KpMAxWABxsjEyAWyNdnMkUcc..... June 19, 2006..... answer
31 ......fGsFQvG4OiUd9hac5VJTdbvv..... June 19, 2006..... question
32 ......E6b8N1pyPfNCBqwRkoqeSM9i..... June 19, 2006..... answer
Code: Select all
$Query = "select * from `table` where date='today' order by `RecordNumber` desc"; // pulls the last question on x date
$LinkID = mysql_query($Query, $Connect);
$Data = mysql_fetch_assoc($LinkID);
echo $Data['Question']; // echo's the question
echo $Data['Answer']; // echo's the question
echo $Data['TimeStamp']; // echo's the timestampCode: Select all
select * from table where date = today order by id desc LIMIT 0,2Code: Select all
<?php
$sql = "SELECT field1, field2, FROM table WHERE datefield = CURDATE() ORDER BY id DESC LIMIT 0, 2";
?>Code: Select all
if($_GET['amount']>0){
$amount = var_dump($_GET['amount']);
$current_date = date("F j, Y");
foreach($types as $type){
$query = mysql_query("SELECT * FROM `codes` WHERE Date='{$current_date}' ORDER BY ID DESC LIMIT 0, $amount");
print("The current ". $display['Type'] ." security encryption code is ". $display['Code'] .".<br>");
}
}Code: Select all
CREATE TABLE question (
id_question INT(5) unsigned not null auto_increment,
de_question VARCHAR(255) not null,
de_answer VARCHAR(255) not null,
PRIMARY KEY (id_question));
Code: Select all
if($_GET['amount']>0){
$amount = var_dump($_GET['amount']);
$current_date = date("F j, Y");
foreach($types as $type){
$query = mysql_query("SELECT * FROM `codes` WHERE Date='{$current_date}' ORDER BY ID DESC LIMIT 0, $amount");
print("The current ". $display['Type'] ." security encryption code is ". $display['Code'] .".<br>");
}
}I really just want to make it show how ever many previous codes the user requests of what ever types they request.Code 1: 12345
Code 2: qwert
-------------------
Code 1: 54321
Code 2: 1qazs