noob problem with php

Discussion in 'PHP' started by whiteblue1942, Apr 11, 2008.

  1. #1
    someone tell me please what the heck im doing wrong!!!



    USE tucoraco_tucora;

    $result = mysql_query('SHOW COLUMNS FROM users');
    if (!$result) {
    die('Invalid query: ' . mysql_error());
    }



    mysql_close($link);



    line 8 is the """USE tucoraco_tucora;""" line by the way


    this is my error......Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in /home/tucoraco/public_html/connect.php on line 8
     
    whiteblue1942, Apr 11, 2008 IP
  2. Oli3L

    Oli3L Active Member

    Messages:
    207
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    70
    #2
    try this:


    $result = mysql_query('SHOW COLUMNS FROM users') or die('Invalid query: ' . mysql_error());
     
    Oli3L, Apr 11, 2008 IP
    whiteblue1942 likes this.
  3. NatalicWolf

    NatalicWolf Peon

    Messages:
    262
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hey, make sure you login to the MySQL server first.

    
    $connect=mysql_connect(); // php.net/mysql_connect
    
    
    PHP:
    Hope that helps:) Hit me up on AIM if you need help.
     
    NatalicWolf, Apr 11, 2008 IP
    whiteblue1942 likes this.
  4. whiteblue1942

    whiteblue1942 Peon

    Messages:
    573
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    #4
    thank you guys a ton rep added for both!
     
    whiteblue1942, Apr 11, 2008 IP
  5. c4st

    c4st Peon

    Messages:
    41
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Also uhm...

    USE tucoraco_tucora; 
    PHP:
    if not PHP, it's SQL.
     
    c4st, Apr 11, 2008 IP