Jump to content


Photo

Mysql content selector help. (query)


  • Please log in to reply
1 reply to this topic

#1 zbrahead

zbrahead
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 20 May 2006 - 07:09 AM

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)
#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); 
im getting queryhead1 error message.

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 20 May 2006 - 08:47 AM


#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); 

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users