Oppure

Loading
10/04/20 18:47
alex1995
salve, ho un problema con questo sorgente:

<?php

require_once('config.php');

$databaseConnection = mysqli_connect(DBHOST, DBUSERNAME, DBPASSWORD, DBNAME);

if (!$databaseConnection)
{
    die('Could not connect: ' . mysql_error());
}

mysqli_query($databaseConnection, "CREATE TABLE torrent (
     torrentid MEDIUMINT NOT NULL AUTO_INCREMENT,
	 torrenthash text NOT NULL,
	 torrenttitle text NOT NULL,
	 torrentdescription text NOT NULL,
     PRIMARY KEY (torrentid)
);") or die("Error: %s\n", mysqli_error($databaseConnection)));


?>


mi da quest errore

Parse error: syntax error, unexpected ',', expecting ')' in C:\xampp\htdocs\query.php on line 18


ma se inserisco la query in phpmyadmin funziona come mai?
aaa
10/04/20 22:17
Goblin
Postato originariamente da alex1995:

salve, ho un problema con questo sorgente:

<?php

require_once('config.php');

$databaseConnection = mysqli_connect(DBHOST, DBUSERNAME, DBPASSWORD, DBNAME);

if (!$databaseConnection)
{
    die('Could not connect: ' . mysql_error());
}

mysqli_query($databaseConnection, "CREATE TABLE torrent (
     torrentid MEDIUMINT NOT NULL AUTO_INCREMENT,
	 torrenthash text NOT NULL,
	 torrenttitle text NOT NULL,
	 torrentdescription text NOT NULL,
     PRIMARY KEY (torrentid)
);") or die("Error: %s\n", mysqli_error($databaseConnection)));


?>


mi da quest errore

Parse error: syntax error, unexpected ',', expecting ')' in C:\xampp\htdocs\query.php on line 18


ma se inserisco la query in phpmyadmin funziona come mai?


bha forse dico una cavolata ... ma io conto una parentesi chiusa ";)" di troppo proprio alla linea 18 ... infatti anche l'errore lo dice
G.
Ibis redibis non morieris in bello