Jump to content

Mysql content selector help. (query)


zbrahead

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.
Link to comment
https://forums.phpfreaks.com/topic/10054-mysql-content-selector-help-query/
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]

Archived

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

×
×
  • 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.