Jump to content

error


Hellusius

Recommended Posts

I was reading through an tutorial about mysql and while doing so I also worked on the database, well I made it and now I wanted to create it on my frontpage I did the following in php

[quote]
<?php
include("header.php");
?>
<?php
$maps = mysql_connect();
if (!$maps)
  {
  die('Could not connect: ' . mysql_error());
  }

$sql = "CREATE DATABASE maps_dp";
if (mysql_query($sql,$maps))
  {
  echo "Database maps_dp created";
  }
else
  {
  echo "Error creating database: " . mysql_error();

mysql_close($maps);
?>

<font size=4>Currect Map section</font>


</body>
</html>
[/quote]

And now my page doesn't load cause of the following error  ???


[quote]Parse error: syntax error, unexpected $end in /home/www/warnicro.awardspace.com/maps.php on line 27[/quote]

any suggestions or am I doing something wrong, cause I am pretty new to this mysql and php

Link to comment
https://forums.phpfreaks.com/topic/15440-error/
Share on other sites

that worked though I now strumbled on another problem which is

[quote]Warning: mysql_connect(): Access denied for user 'warnicro'@'64.69.39.75' (using password: NO) on line 5
Could not connect: Access denied for user 'warnicro'@'64.69.39.75' (using password: NO)[/quote]

do I need to fill in the array or something of the mysql_connect?
Link to comment
https://forums.phpfreaks.com/topic/15440-error/#findComment-62590
Share on other sites

The page loads now but I get an error at he top saying

[code]Error creating database: Access denied for user 'warnicro_01'@'64.69.39.75' to database 'maps_dp' [/code]

the code looks like this

[code]<?php
include("header.php");
?>
<?php
$sql = 'INSERT INTO `db1` (`Maps`) VALUES (\'1\')';
$maps = mysql_connect("db5.awardspace.com","warnicro_01","E23V24");
if (!$maps)
  {
  die('Could not connect: ' . mysql_error());
  }

$sql = "CREATE DATABASE maps_dp";
if (mysql_query($sql,$maps))
  {
  echo "Database maps_dp created";
  }
else
  {
  echo "Error creating database: " . mysql_error($maps);

mysql_close($maps);
  }
?>

<font size=4>Currect Map section</font>


</body>
</html>[/code]
Link to comment
https://forums.phpfreaks.com/topic/15440-error/#findComment-63754
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.