Search
Left Quote    Wise men speak because they have something to say; Fools because they have to say something.
- Plato (427-347 B.C.)    
Right Quote
 
[login] | [Register]
Forum Index » PHP and mySQL » Viewing Topic and Replies
Post Reply


        Viewing Topic: hey help me!
  This user is offline  james
  Subject: "hey help me!" Posted: @ 7:15 pm on Jul 17 2008   
Member #: 720
Rank: User - (9)
Since: 07/17/08
Posts: 9

hello

could you tell why there is not a working example link are deleted?
http://www.alls yntax.com/tutor ials/PHP/23/Pag ination-with-PH P/6.php

ty


    Viewed: 20,078 Times | Reply to This | To top
  This user is offline  David1159
  Subject: "re: hey help me!" Posted: @ 7:30 pm on Jul 17 2008    

Member #: 526
Rank: User - (81)
Since: 12/27/07
Posts: 81
From: usa

All the code is there you need.

Just go from page to page, and use the small bits of code. Once combined it is the working example in the end.

Plus you'll be able to read along to learn how it works.




Coding is simply CST... Combining $hit Together. We make different $hit to run in unison correctly.

    Viewed: 20,070 Times | Reply to This | To top
  This user is offline  james
  Subject: "re: hey help me!" Posted: @ 8:02 pm on Jul 17 2008    
Member #: 720
Rank: User - (9)
Since: 07/17/08
Posts: 9

want the zip file

thanks




    Viewed: 20,067 Times | Reply to This | To top
  This user is offline  james
  Subject: "re: hey help me!" Posted: @ 11:51 pm on Jul 17 2008    
Member #: 720
Rank: User - (9)
Since: 07/17/08
Posts: 9

please!




    Viewed: 20,060 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: hey help me!" Posted: @ 3:03 am on Jul 18 2008    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

NO zip file needed. Code is provided. You want an example of pagination? It on every tutorial, tutorial cateogry listing as well as code sections of this site. --link to full code--




-bs0d | AllSyntax.com

    Viewed: 20,049 Times | Reply to This | To top
  This user is offline  james
  Subject: "re: hey help me!" Posted: @ 5:15 am on Jul 18 2008    
Member #: 720
Rank: User - (9)
Since: 07/17/08
Posts: 9

    Viewed: 20,042 Times | Reply to This | To top
  This user is offline  Genius
  Subject: "re: hey help me!" Posted: @ 11:04 am on Jul 18 2008    

Member #: 582
Rank: User - (77)
Since: 02/18/08
Posts: 76
From: kmmk

Does your host allow php? and does it allow short tags?

If you have php in your host, problem could be this:

Try changing "<?&q uot; to "<?php " (without quotes)




    Viewed: 20,032 Times | Reply to This | To top
  This user is offline  james
  Subject: "re: hey help me!" Posted: @ 2:45 pm on Jul 18 2008    
Member #: 720
Rank: User - (9)
Since: 07/17/08
Posts: 9

*No database selected*

where should i make the database? I cant find to put my localhost etc...



Edited at 02:46:48 pm on 07/18/08


    Viewed: 20,026 Times | Reply to This | To top
  This user is offline  Persis
  Subject: "re: hey help me!" Posted: @ 3:48 pm on Jul 18 2008    
Member #: 719
Rank: User - (7)
Since: 07/16/08
Posts: 6
From: USA

you should have a MySQL option in your admin panel that you can use for making databases. if you need to add a table to your database you probably have PHPMyAdmin or your host might have an alternative to it. If you're using a free site host or something they might either not have MySQL or they have a small number of databases, like 3 or something, that you're allowed to use.




persistentpersi
s@gmail.com |     Viewed: 20,019 Times | Reply to This | To top
  This user is offline  james
  Subject: "re: hey help me!" Posted: @ 4:15 pm on Jul 18 2008    
Member #: 720
Rank: User - (9)
Since: 07/17/08
Posts: 9

i have MYSQL but where should it work and why doesnt it work??????????? ??????????????? ?




    Viewed: 20,016 Times | Reply to This | To top
  This user is offline  Persis
  Subject: "re: hey help me!" Posted: @ 4:18 pm on Jul 18 2008    
Member #: 719
Rank: User - (7)
Since: 07/16/08
Posts: 6
From: USA

do you have like an admin panel that shows all the things you can do, ie. creating files/directori es, creating databases, etc.?




persistentpersi
s@gmail.com |     Viewed: 20,013 Times | Reply to This | To top
  This user is offline  james
  Subject: "re: hey help me!" Posted: @ 6:33 pm on Jul 18 2008    
Member #: 720
Rank: User - (9)
Since: 07/17/08
Posts: 9

  Persis said...

< i> do you have like an admin panel that shows all the things you can do, ie. creating files/directori es, creating databases, etc.?

yes




    Viewed: 20,010 Times | Reply to This | To top
  This user is offline  Genius
  Subject: "re: hey help me!" Posted: @ 7:06 pm on Jul 18 2008    

Member #: 582
Rank: User - (77)
Since: 02/18/08
Posts: 76
From: kmmk

Cpanel?

Anyway find a option where you can add databases. Add a database and user and give all privileges to that user. Then go to phpmyadmin that should be included in the admin panel. Select your database then select SQL to insert info into your database and paste the SQL from the tutorial.




    Viewed: 20,006 Times | Reply to This | To top
  This user is offline  james
  Subject: "re: hey help me!" Posted: @ 7:28 pm on Jul 18 2008    
Member #: 720
Rank: User - (9)
Since: 07/17/08
Posts: 9

this code is uselles and doesnt work, noob scritp:

<?
//REMEMBER TO CONNECT TO DATABASE!

//**EDIT TO YOUR TABLE NAME, ECT.

$t = mysql_query(&q uot;SELECT * FROM `table` WHERE `cat` = '".addsl ashes($_GET['c at'])." '";
if(!$t) die(mysql_error ());

$a = mysql_fetch_obj ect($t);
$total_items = mysql_num_rows( $t);
$limit = $_GET['limit' ];
$type = $_GET['type'] ;
$page = $_GET['page'] ;

//set default if: $limit is empty, non numerical, less than 10, greater than 50
if((!$limit) || (is_numeric($li mit) == false) || ($limit < 10) || ($limit > 50)) {
$limit = 10; //default
}
//set default if: $page is empty, non numerical, less than zero, greater than total available
if((!$page) || (is_numeric($pa ge) == false) || ($page < 0) || ($page > $total_items)) {
$page = 1; //default
}

//calcuate total pages
$total_pages = ceil($total_ite ms / $limit);
$set_limit = $page * $limit - ($limit);

//query: **EDIT TO YOUR TABLE NAME, ECT.

$q = mysql_query(&q uot;SELECT * FROM `table` WHERE `cat` = '".addsl ashes($_GET['c at'])." ' LIMIT $set_limit, $limit";
if(!$q) die(mysql_error ());
$err = mysql_num_rows( $q);
if($err == 0) die("No matches met your criteria." ;

//Results per page: **EDIT LINK PATH**
echo("
<a href=www.yoursi te.com/stuff/sc ript.php?cat=$c at&amp;limi t=10&amp;pa ge=1>10</ a> |
<a href=www.yoursi te.com/stuff/sc ript.php?cat=$c at&amp;limi t=25&amp;pa ge=1>25</ a> |
<a href=www.yoursi te.com/stuff/sc ript.php?cat=$c at&amp;limi t=50&amp;pa ge=1>50</ a>";

//show data matching query:
while($code = mysql_fetch_obj ect($q)) {
echo("ite m: ".$code-& gt;title." ;<BR>&qu ot;
}

$cat = urlencode($cat) ; //makes browser friendly

//prev. page: **EDIT LINK PATH**

$prev_page = $page - 1;

if($prev_page >= 1) {
echo("< ;b>&lt;& amp;lt;</b&g t; <a href=http://www .yoursite.com/s tuff/script.php ?cat=$cat&a mp;limit=$limit &amp;page=$ prev_page>&l t;b>Prev.< ;/b></a&g t;";
}

//Display middle pages: **EDIT LINK PATH**

for($a = 1; $a <= $total_pages; $a++)
{
if($a == $page) {
echo("< ;b> $a</b> | "; //no link
} else {
echo(" <a href=http://www .yoursite.com/s tuff/script.php ?cat=$cat&a mp;limit=$limit &amp;page=$ a> $a </a> | ";
}
}

//next page: **EDIT THIS LINK PATH**

$next_page = $page + 1;
if($next_page <= $total_pages) {
echo("< ;a href=http://www .yoursite.com/s tuff/script.php ?cat=$cat&a mp;limit=$limit &amp;page=$ next_page>&l t;b>Next< /b></a> ; &gt; &gt;"< img src=http://www. allsyntax.com/f orums/images/sm ilies/wink.gif border=0>;
}

//all done
?>




    Viewed: 20,002 Times | Reply to This | To top
  This user is offline  james
  Subject: "re: hey help me!" Posted: @ 5:04 am on Jul 19 2008    
Member #: 720
Rank: User - (9)
Since: 07/17/08
Posts: 9

so now how can i open a databse and where are the Localhost DBname password??

answer me with info and not dumb questions.




    Viewed: 19,990 Times | Reply to This | To top
  This user is offline  David1159
  Subject: "re: hey help me!" Posted: @ 5:44 am on Jul 28 2008    

Member #: 526
Rank: User - (81)
Since: 12/27/07
Posts: 81
From: usa

  james said...

< i> so now how can i open a databse and where are the Localhost DBname password??

answer me with info and not dumb questions.


Every question replied in your post! Help us understand what you asked us poorly in the beginning! A computer is only as good as its user, the same goes from person to person in a conversation.
And to your question in the quotes. Yes, you have to create a database. Maybe ask a dumb question like, how to create a database?

I hope when you said n00b script in your early post, it was relating to your script. Frankly the code your showing (basic from the tut) doesn't even know where to go to connect the database and where to connect to what table... Plus it the Pagination on the pages won't know where to go since it hasn't been defined in the <a href="... .

I am sorry... You can go to ANY website, ask for what you exactly want. It will not happen. There are no zips to your exact need out there. If you found ONE zip that you need and try to add it to another zip it will not work unless you have a basic understanding of the coding evolved to combine them.... ... . .

As my Signature says, CST! COMBINING $hit TOGETHER. Combing a membership system, to a pagination system, to a rank system, to a search system, to a posting system.... all working together in unison without errors.




Coding is simply CST... Combining $hit Together. We make different $hit to run in unison correctly.

    Viewed: 19,801 Times | Reply to This | To top
Viewing Page: 1 of 1


1 |

You must be logged in to post on the forums. Login or Register








"AllSyntax.com" Copyright © 2002-2018; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank