Results 1 to 2 of 2

Thread: Problem connecting to mysql

  1. #1

    Thread Starter
    Hyperactive Member xxarmoxx's Avatar
    Join Date
    Mar 2007
    Posts
    378

    Problem connecting to mysql

    This is what Im doing:

    PHP Code:
    echo "1";
    $con mysql_connect($c,$l,$p);
    echo 
    "2";

    if (
    $con) { echo "connected!"; }
    if (!
    $con)
    {
    echo 
    "No Go";
    die(
    'Could not connect: ' mysql_error());


    All I see is '1' and no other output. What could be wrong?

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Problem connecting to mysql

    mysql_connect must be throwing a fatal error, but you've got error reporting off.
    Place this line before the rest of your code:
    PHP Code:
    error_reporting(E_ALL E_STRICT); 
    Alternatively, suppress the error by prepending the error control operator @ before the call to mysql_connect().
    PHP Code:
    $con = @mysql_connect($c$l$p); 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width