Hello,
I have the following code:
<?php
$link = mysql_connect('localhost', 'root', 'geheim');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_select_db(ebay);
$query = "SELECT * FROM Auctions";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
foreach($row as $field=>$value)
{
echo "$field: {$value} <br />";
}
}
mysql_close($link);
?>
Which works seemingly fine, and gives this output:
Connected successfully
Notice: Use of undefined constant ebay - assumed 'ebay' in C:\Programme\EasyPHP 2.0b1\www\test.php on line 10
ARTICLE_NO: '110268889894'
ARTICLE_NAME: 'ORIGINAL 2008 ED HARDY GÜRTEL* MYSTERY LOVE * M *BLACK'
SUBTITLE: ''
CURRENT_BID: $0.00
START_PRICE: $0.00
BID_COUNT: 7
QUANT_TOTAL: 0
QUANT_SOLD: 1
STARTS: 0000-00-00 00:00:00
ENDS: 0000-00-00 00:00:00
ORIGIN_END: 0000-00-00 00:00:00
SELLER_ID: 7/8/2008 17:18:37
BEST_BIDDER_ID: 11/5/2008 16:23:37
FINISHED: 10/6/2008 17:23:37
The problem is that the data does not seem to be correct, the start and end times for example, is this because I set the mysql field to type DATETIME and it does not understand the numbers?
Is there a way to get the insert date from the current date when inserting with mysql(not php)
I would like to display the records as one row per line, how would I do this? And if possible, clicking on a record would display more information above it.