Jump to content

[SOLVED] I am having a hard time


ccrevcypsys

Recommended Posts

connecting to my database.

Every time i put the code in the page just turns blank. It doesnt make sence...

Im hosting off of localhost at my office.

heres my code

$user ="root";
$pass ="";
$db ="nnds";
$link = @mysql_connect ("localhost", $user, $pass );
if( !$link){
die("Couldn't Connect To MySQL: ".mysql_error() );
}
print "<h2> Successfully connected to database \"$db\"<br /> \n";

$mysql_select_db( $db )
  or die ( "Couldn't open $db: ".mysql_error() );

mysql_close( $link );

Link to comment
Share on other sites

Blank pages are usually caused by fatal parse or fatal runtime errors. Check your web server log for errors or turn on full php error reporting in php.ini or a .htaccess file (turning on error reporting in your script will not show fatal parse errors because your script never runs.)

Link to comment
Share on other sites

i fixed it but now i have this code

<?php
$user ="root";
$pass ="dragon";
$db ="nnds";
$link = @mysql_connect ("localhost", $user );
if( !$link){
die("Couldn't Connect To MySQL: ".mysql_error() );
}
mysql_select_db( $db )
  or die ( "Couldn't open $db: ".mysql_error() );
print "<h2> Successfully connected to Server \"$db\"<br /> \n";
  
mysql_close( $link );
?>

and now i get this error

Fatal error: Function name must be a string in C:\xampp\htdocs\nnds\admin\aztmoprtmphli1135388593938274\newEdit.php on line 9

Link to comment
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.