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
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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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