Please read and help me out :)

Discussion in 'PHP' started by Xplicit.Syrian, Oct 25, 2007.

  1. #1
    I am new to php =)

    For the past few weeks, i been reading alot of php tutorials so i am familer with it.
    I created a mysql databse named "blog", i am creating my frist blog page.

    Well, i have this problem

    I am trying to connect my varibles to the database i created but i am getting this error...



    Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\wamp\www\phpvt\lesson01\global.php:2) in C:\wamp\www\phpvt\lesson01\global.php on line 3

    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\wamp\www\phpvt\lesson01\global.php:2) in C:\wamp\www\phpvt\lesson01\global.php on line 3

    Fatal error: Call to undefined function mysql_connect_db() in C:\wamp\www\phpvt\lesson01\global.php on line 5

    the code i added before the html tag is
    
    <?php
    	session_start();
    	$connect = mysql_connect(localhost,root,"") or die(mysql_error());
    	$db = mysql_connect_db(blog.$connect);
    	$session_name = $_session['uid'];
    	
    ?>
    
    Code (markup):
    Did i make a mistakes somewhere ??

    Thanks :)
     
    Xplicit.Syrian, Oct 25, 2007 IP
  2. Lordy

    Lordy Peon

    Messages:
    1,643
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #2
    is $_session['uid'] set?

    alternatively, i think you should use mysql_select_db
     
    Lordy, Oct 25, 2007 IP
  3. Xplicit.Syrian

    Xplicit.Syrian Peon

    Messages:
    74
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Oh i feel embarassed, Thanks alot :)
     
    Xplicit.Syrian, Oct 26, 2007 IP