Sta je ovdje greska ?
<?php
$link = mysql_connect('host', 'dtbs, 'sifra');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully ';
$db_selected = mysql_select_db('dtbs', $link);
if (!$db_selected) {
die ('Can\'t use foo : ' . mysql_error());
}
$stvori = mysql_query('CREATE TABLE joke (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
joketext TEXT ,
jokedate TEXT NOT NULL '); <<<<<<<<<<<
if (!$stvori) {
die(' Invalid query: ' . mysql_error());
}
$ubaci = mysql_query('INSERT INTO joke SET
joketext = "Why did the chicken cross the road? To get to the other side!", jokedate = "2007-07-31"; ');
$citaj = mysql_query('SELECT * FROM joke');
?>
Greska
Citat:Connected successfully Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 4
Oznacio sam tamo gdje bi trebala biti greska.
Dopuna: 31 Jul 2007 20:25
Nasao sam mucka stavio sam ' prije zatvaranja zagrade
|