Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.