Jump to content

Taro

Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Taro's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. www.freesql.com hosts mysql databases. That's external, but much easier than xml and changing manual stuff.
  2. [!--quoteo(post=323462:date=Nov 30 2005, 05:27 PM:name=khan kaka)--][div class=\'quotetop\']QUOTE(khan kaka @ Nov 30 2005, 05:27 PM) 323462[/snapback][/div][div class=\'quotemain\'][!--quotec--] thanks for your help it worked but the problem was if i had 100 records and i displayed only 20 per page and when i click next page. on the next page it starts agin from 1 where is should start from 20. i found a solution for it if i place this code outside loop it works fine and starts the new page from 20 or what ever the number should be. ooo this is one i can help with! All you do is wherever you have your "next page" link, add a get var "xxx.php?s=20" and then do something like this... //from xxx.php?s=20 if(isset($_GET["s"])) { $s = $_GET["s"]; } else { $s = 0; } $e = $s+20 //add this to your query like so $sql = "SELECT * FROM `table` ORDER BY `field` DESC LIMIT $s, $e"; //the LIMIT clause is the key there, the first number is the entry number to begin displaying by //the second is where to stop.
  3. Well, considering that you don't know how to do this, you're probably using cookies. If you're using cookies, i can help. It's really easy. To log in with a cookie, don't just put a few variables in a few cookies. This is a pretty easy trick to use. //login code //put this above the <html> tag(whenever or however you output it) $user = array(); $userdata_sql = "'SELECT * FROM `users` WHERE `id` = $id"; //or however you prefer doing MySQL queries... $userdata = mysql_query($userdata_sql); while($userd = mysql_fetch_assoc($userdata)) { $x = implode(',', $userd); setcookie('user', $x, time()+999999); } //"session" management //really isn't session variables! if(isset($_COOKIE["user"])) { list($user["name"], $user["id"]) = explode('.', $_COOKIE["user"]); //the list must be in exact order as the fields in your mysql database. } //then just put $user["name"] wherever you want their name to be. simple, no? It's an easy way to emulate session management without really learning session techniques. It's not near as secure, though.
×
×
  • 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.