Jump to content


Photo

multiple search pages


  • Please log in to reply
32 replies to this topic

#21 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 02 August 2006 - 09:26 PM

/ is the root. even if you're in the shell, you can access the root files by using /root.pl. therefore, you always see this kind of thing in a perl script like /usr/bin/perl

whatever.php or ./whatever.php is the current directory
../whatever.php is one up
/whatever.php always give you the root
Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...

#22 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 02 August 2006 - 09:32 PM

../whatever.php is one up
ok let me recap one more time, tell me if I am right, I just need to get this memorized now.

Ok root directory can always be accessed
with
/whatever.php
that pulls the root directory, if I am in a sub-directory or lower, I can still use
/whatever.php to pull a root directory file out.
Ok now if I am in a folder, in one level, I use
for getting to a file within that SAME directory I can use
whatever.php
what does
./whatever.php do, with just one dot. 
and ../whatever.php do with 2 dots what are the 2 different between those
I understand
/whatever.php is root directory
whatever.php is for whatever directory I am in, if the file I am accessing is in the same directory this will access it
what is ./ and ../
the reason I am confused is I have includes
in /include/whatever.inc.php
and I always when I enter my includes it is always
include './includes/whatever.php'
or if I have a nav in an include, on every link in my nav if I put ../ before each one anyway I don't normally have problems.  How do I know the difference??  Sorry to ask this, but you have taught me something I had no idea about and it'll make my job 100 times easier in the future.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#23 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 02 August 2006 - 09:41 PM

../ means go one level up. if you're in /root/level2/level3, ../ gives you anything in level2. you can use ../../ to get to root from level3 too.

the one dot basically mean the current directory. i don't use it often, but i guess it might be useful on some cases. someone correct me on this if i'm wrong.

i'm not saying that you should always use / and abandon ../. just choose whichever is best for you in a situation.

Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...

#24 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 02 August 2006 - 09:51 PM

well bottom line is what you told me fixed the problem in this situation, and even if I continue the other method this is something I will definitely keep in mind for other situations where I encounter similar options.  Thanks ryan.
Also if your reading this wildteen, in a post you put down yesterday a theory that helped me tremendously
<?php
echo "Debug Information";
echo "<br />"
echo "Contents of variable whaever



echo "End Debug Information";
?>
whatever like that, when I encounter massive problem I take 5 minutes to create an entire debug program to just empty all my variables, check all my calculations and everything where I am having the problem and within 4 minutes I calculated the location of the problem and fixed it.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#25 legohead6

legohead6
  • Members
  • PipPipPip
  • Advanced Member
  • 434 posts

Posted 02 August 2006 - 10:12 PM

umm wow i got lost there..but i think one of the things you said was searching through catagorys and displaying...i dunno but if so in the original code i had searching through catagorys working with paginating...i can show if you want...
"Syntax error" .. WHERE THE **** IS IT?!

#26 legohead6

legohead6
  • Members
  • PipPipPip
  • Advanced Member
  • 434 posts

Posted 02 August 2006 - 10:14 PM

Ok here is the thing, I am developing something, I sort of understand the general theory.
I create my queries, limit it, at like 60 since there just links
so I would use limit 60
I know then on the other page, THe next query would be
LIMIT 60, 60
then
LIMIT 60, 120
that would telll it limit 60 starting at row 120, then on the next it's like
LIMIT 60, 180
and so forth, I know about this part, I also know how to get the links to appear, or I can come up with something, what I don't understand is do I have to create a physical page for each occurence.  Like do I have to create test
test1, test2, test3, test4, test5 and so forht, even if there not all used all the time
so it would show 60 on test 1, 60 on test 2 and so forth.
But that makes me also wonder because I have to do this same thing, in about 100 different areas, I have to make it paginate seperately for each category, sub-category, and when they run specific search criteria?


you would have to use fwrite? i think thats what you mean
"Syntax error" .. WHERE THE **** IS IT?!

#27 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 03 August 2006 - 12:14 PM

umm wow i got lost there..but i think one of the things you said was searching through catagorys and displaying...i dunno but if so in the original code i had searching through catagorys working with paginating...i can show if you want...
any examples my help me formulate my idea better.  I have the entire system maps out except how to do pagination, except feeding it back on another page, and carrying category and sub-category with it, but then I have the issue of getting all the extra pages to appear on that page is well, and mantain the same information
hmm

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#28 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 03 August 2006 - 01:21 PM

I have the framework laid out, I think i can get this to work, I can not populate my query, actually I have done, I am just testing it when I get back from taking my dog to the vet.  Next thing will be to try and get multiple pages to show up, I will come up with something for that, afterwards.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#29 legohead6

legohead6
  • Members
  • PipPipPip
  • Advanced Member
  • 434 posts

Posted 03 August 2006 - 03:02 PM

umm wow i got lost there..but i think one of the things you said was searching through catagorys and displaying...i dunno but if so in the original code i had searching through catagorys working with paginating...i can show if you want...
any examples my help me formulate my idea better.  I have the entire system maps out except how to do pagination, except feeding it back on another page, and carrying category and sub-category with it, but then I have the issue of getting all the extra pages to appear on that page is well, and mantain the same information
hmm


heres my search code its got 1 catagory the only thing not here is the accual displaying of the numbers of pages...... but it shows that on my other code

$pvs=$_GET['pvs'];
if(isset($_POST['submit']) OR $pvs != ''){
if(!empty($pvs)){
$search=$pvs;
$catagory=$_GET['c'];
}else{
$search=$_POST['search'];
$catagory=$_POST['catagory'];
}
$display = 10;
if($catagory !== "All_Catagorys"){
$counting = "SELECT COUNT(*) FROM listings WHERE title LIKE '%$search%' AND cat='$catagory' OR  description LIKE '%$search%' AND cat='$catagory' ORDER BY id ASC";
$showing = "SELECT * FROM listings WHERE title LIKE '%$search%' AND cat='$catagory' OR  description LIKE '%$search%' AND cat='$catagory' LIMIT $start, $display";
}else{
$counting = "SELECT COUNT(*) FROM listings WHERE title LIKE '%$search%' OR  description LIKE '%$search%' ORDER BY id ASC";
$showing = "SELECT * FROM listings WHERE title LIKE '%$search%' OR  description LIKE '%$search%' LIMIT $start, $display";
}


$page = "$counting";
$resultp = mysql_query($page);
$row = mysql_fetch_array($resultp, MYSQL_NUM);
$num_records = $row[0];

echo "<p align=center>There are $num_records Listings</p>";
if(isset($_GET['np'])){
$num_pages = $_GET['np'];
}else{
$page = "$counting";
$resultp = mysql_query($page);
$row = mysql_fetch_array($resultp, MYSQL_NUM);
$num_records = $row[0];
if($num_records > $display){
$num_pages = ceil($num_records/$display);
}else{
$num_pages = 1;
}
}
$query2="$showing";




}

"Syntax error" .. WHERE THE **** IS IT?!

#30 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 03 August 2006 - 05:24 PM

I can strip this down some in my own application if I run into a road block, until I get my application running thouroughly but I realized just now some of my older scripts have problems(not problems) but I forgot to add in a few features that were asked I am going to try to get those situated right now.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#31 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 03 August 2006 - 07:03 PM

<?php
	$connect = mysql_connect("localhost", "#####", "######");
	$select = mysql_select_db("elostand_general");
	$directory = split("/", $_SERVER['PHP_SELF']);
	$category = $directory[1];
	$subcategory = $directory[2];
	$newarray = explode(".", $subcategory);
	$subcategory = $newarray[0];
	$select = "SELECT * FROM foundpostings WHERE category = '$category' AND subcategory = '$subcategory';";
	$query = mysql_query($select);
	while ($row = mysql_fetch_array($query)) {
		echo "<a href=\"/view/foundpost/{$row[foundpostid]}\" target=\"_blank\">{$row[generictitle]}</a>";
		$test = true;
	}
	if ($test != true) {
	echo "<span class=\"logspan\">";
	echo "I apologize but your current search did not yield any results.<br />";
	echo "Please try your search again, or nothing came up with this search<br />";
	echo "criteria<br />";
	echo "</span>";
	}
	?>
Ok this is the system I set up now, the redirects work, everything populates properly.  I need to ask something now, here is when I need to ask a question.
The thing now is the pagination, I may not even need it, I could probably populate 100-200 per set, but eventually the site may get big enough to get bigger than that, but for now, what direction should I gear this to paginate.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#32 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 03 August 2006 - 07:20 PM

quick help here, anyone with big guns or big balls.
Anyone with pagination experiences.
Ideas, hints, tips, and tricks welcome.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#33 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 03 August 2006 - 07:37 PM

nevermind I nixed pagination until the site get's bigger, it can just live with whatever number of queries per page.  because of this price on this project, I am only putting int he necessities, and at 100 post's per page, I don't need to worry about it displaying anything, so I will set it up like this for now, and integrate pagination later on.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users