Jump to content

Adri

Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Adri's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey, I have a site with a survey. After the first page, this is the script that I run: [code]include 'db_connect.php'; $inleiding = mysql_query("SELECT * FROM inleiding") or die(mysql_error()); $count_inleiding = mysql_num_rows($inleiding) or die(mysql_error()); echo $count_inleiding; $id = $count_inleiding + 1; echo $id; $cookie_data = $id; if (setcookie("enquete", $cookie_data, $time+31536000)==TRUE)     {     if (isset($_COOKIE['enquete']))         {               $cookie_info = explode("-", $_COOKIE['enquete']);               $uid = $cookie_info[0];                      if ((empty($_POST[v01a1]))             && (empty($_POST[v01a2]))) ... ... [/code] It doesn't do anything. echo $count_inleiding doesn't give any result and neither does echo $id; The table is empty. Anybody knows what I'm doing wrong?
  2. Hey all, I heva this problem with the listing of my results. I have a lot of entries in the database and I retreieve them with: [code]$getentries = mysql_query("SELECT * FROM guestbook ORDER BY id DESC");[/code] Now, I want to show them with 15 at a time. For this I use: [code]$start = $offset (=0, 15, 30, 45, depending on which page of the results you are) $stop = $offset + 15 for ($i=$start; $i<=$stop; $i++) { echo $whatever; }[/code] The problem is, that when $start=15 and $stop=30 he displays the same results as when $start=0 and $stop=15. He just always takes the first 15 results out of the array :s. How come?!?
×
×
  • 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.