Jump to content

Archived

This topic is now archived and is closed to further replies.

zbrahead

Mysql content selector help. (query)

Recommended Posts

I have produced this script after a few days on it and i managed to debug it to the query, now the query function provides an error message ( a custom or die() one) and i have tinkered with it for along time and cannot fix this. Any help would be GRAVELY appretiated , im at breaking point
here is my script: (there is html below but u dont need to see that [img src=\"style_emoticons/[#EMO_DIR#]/wink.gif\" style=\"vertical-align:middle\" emoid=\":wink:\" border=\"0\" alt=\"wink.gif\" /] and passwords in mysql_connect function covered with asterisks for security purposes)
[code]
#get page datafrom url
$page = $_GET['page'];


#Detect which page called and handle variables et
$rs = @mysql_connect("localhost","******","******")
        or die("ERR:CONN");
    $rs = @mysql_select_db("pages")
        or die("ERR:DB");
      $sqlhead1 = 'SELECT * FROM $page WHERE variable like \'head1\' LIMIT 0, 30 ';
      $sqlmsg1 = 'SELECT * FROM $page WHERE variable like \'head1\' LIMIT 0, 30 ';
      $sqlhead2 = 'SELECT * FROM $page WHERE variable like \'head1\' LIMIT 0, 30 ';
      $sqlmsg2 = 'SELECT * FROM $page WHERE variable like \'head1\' LIMIT 0, 30 ';
      
        $rs = mysql_query($sqlhead1)
        or die(queryhead1);
    
      $head1 = Mysql_fetch_array($rs);
    $rs = mysql_query($sqlmsg1,$conn) or die(queryhead1);
    
      $msg1 = Mysql_fetch_array($rs);
    $rs = mysql_query($sqlhead2,$conn)or die(querymsg1);

     $head2 = Mysql_fetch_array($rs)or die(queryhead2);
    $rs = mysql_query($sqlmsg2,$conn)or die(querymsg2);
      
      $msg2 = Mysql_fetch_array($rs);
[/code]
im getting queryhead1 error message.

Share this post


Link to post
Share on other sites
[code]

#get page datafrom url
$page = $_GET['page'];


#Detect which page called and handle variables et
$rs = mysql_connect("localhost","******","******")
        or die("ERR:CONN");
    mysql_select_db("pages",$rs)
        or die("ERR:DB");
      $sqlhead1 = 'SELECT * FROM $page WHERE variable like \'head1\' LIMIT 0, 30 ';
      $sqlmsg1 = 'SELECT * FROM $page WHERE variable like \'head1\' LIMIT 0, 30 ';
      $sqlhead2 = 'SELECT * FROM $page WHERE variable like \'head1\' LIMIT 0, 30 ';
      $sqlmsg2 = 'SELECT * FROM $page WHERE variable like \'head1\' LIMIT 0, 30 ';
      
        $rs = mysql_query($sqlhead1)
        or die(queryhead1);
    
      $head1 = Mysql_fetch_assoc($rs);
    $rs = mysql_query($sqlmsg1,$conn) or die(queryhead1);
    
      $msg1 = Mysql_fetch_assoc($rs);
    $rs = mysql_query($sqlhead2,$conn)or die(querymsg1);

     $head2 = Mysql_fetch_assoc($rs)or die(queryhead2);
    $rs = mysql_query($sqlmsg2,$conn)or die(querymsg2);
      
      $msg2 = Mysql_fetch_assoc($rs);
[/code]

Share this post


Link to post
Share on other sites

×

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.