NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page php/mysql help

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 06-20-2008, 10:23 AM THREAD STARTER               #1 (permalink)
Senior Member
 
-Ray-'s Avatar
Join Date: Jun 2005
Location: Pennsylvania
Posts: 1,839
-Ray- has much to be proud of-Ray- has much to be proud of-Ray- has much to be proud of-Ray- has much to be proud of-Ray- has much to be proud of-Ray- has much to be proud of-Ray- has much to be proud of-Ray- has much to be proud of-Ray- has much to be proud of
 



php/mysql help


-----SOLVED---------

I am in the middle of creating a search by letter script, except, i have ran into some trouble..

i want the user to be able to click a letter and it show all the results with that letter. no problem.. already done using..

PHP Code:

$alp
=$_GET[a];
while(
$row mysql_fetch_array$result )) {

$word$row['title'];
????: NamePros.com http://www.namepros.com/programming/483944-php-mysql-help.html
$id=$row['id'];


$ab substr($word01); 

$str strtolower($ab);

if(
$alp != $str){

}
else{

echo (
"<br>" $id  ."-<a href=\"$id/\">" $data[0] . "</a>");


But, now, i want to make a paging script to page the data, but i cannot due that because i cannot count the mysql data in this way. I do not know how to and i am soo confused. every time i make a paging function i used a mysql count


this is what i believe it would have to look like but, we no its not going to work.. lol
PHP Code:
select title where title="substr($word, 0, 1)" 
????: NamePros.com http://www.namepros.com/showthread.php?t=483944
__________________
Poker News, articles, discussion
LIKE THIS

Its an iPod, a phone, and an internet communications device.
Last edited by -Ray-; 06-20-2008 at 11:07 AM.
-Ray- is offline  
Old 06-20-2008, 10:33 AM   #2 (permalink)
Traveller
 
-NC-'s Avatar
Join Date: Mar 2007
Location: Yet another city
Posts: 1,419
-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future
 


Animal Cruelty Animal Rescue Ethan Allen Fund Protect Our Planet
select title where LEFT(title,1) = $yourletter

http://dev.mysql.com/doc/refman/5.0/...#function_left

__________________
NameCooler.com
-NC- is offline  
Old 06-20-2008, 10:38 AM THREAD STARTER               #3 (permalink)
Senior Member
 
-Ray-'s Avatar
Join Date: Jun 2005
Location: Pennsylvania
Posts: 1,839
-Ray- has much to be proud of-Ray- has much to be proud of-Ray- has much to be proud of-Ray- has much to be proud of-Ray- has much to be proud of-Ray- has much to be proud of-Ray- has much to be proud of-Ray- has much to be proud of-Ray- has much to be proud of
 



thanks.. ill try that...
__________________
Poker News, articles, discussion
LIKE THIS

Its an iPod, a phone, and an internet communications device.
-Ray- is offline  
Old 06-20-2008, 10:41 AM   #4 (permalink)
Traveller
 
-NC-'s Avatar
Join Date: Mar 2007
Location: Yet another city
Posts: 1,419
-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future
 


Animal Cruelty Animal Rescue Ethan Allen Fund Protect Our Planet
no problem, glad it worked, you could also use

where title LIKE '$yourletter%'
http://dev.mysql.com/doc/refman/5.0/...functions.html

not sure which one is more efficient...

edit: hey! you edited your post, did it not work after all?
__________________
NameCooler.com
-NC- is offline  
Old 06-20-2008, 10:48 AM THREAD STARTER               #5 (permalink)
Senior Member
 
-Ray-'s Avatar
Join Date: Jun 2005
Location: Pennsylvania
Posts: 1,839
-Ray- has much to be proud of-Ray- has much to be proud of-Ray- has much to be proud of-Ray- has much to be proud of-Ray- has much to be proud of-Ray- has much to be proud of-Ray- has much to be proud of-Ray- has much to be proud of-Ray- has much to be proud of
 



i trying it on function one... it worked... im trying it on function 2 now

final code... works... thanks


PHP Code:
<?php

$alp
=$_GET[a];
require(
"pagerclass.php");
$limit="20";

mysql_connect("localhost""------------") or die(mysql_error());
mysql_select_db("---------") or die(mysql_error());

$p = new Pager;
$start $p->findStart($limit);
 

$count mysql_num_rows(mysql_query("SELECT * FROM drink WHERE LEFT(title,1) = '$alp'"));
????: NamePros.com http://www.namepros.com/showthread.php?t=483944
????: NamePros.com http://www.namepros.com/showthread.php?t=483944

$pages $p->findPages($count$limit);

$pagelist $p->pageList($_GET['page'], $pages$urlqry);
echo 
$pagelist;


$result mysql_query("SELECT title,id FROM drink where LEFT(title,1) = '$alp' ORDER BY title ASC LIMIT $start$limit")
or die(
mysql_error());  

while(
$row mysql_fetch_array$result )) {

$word$row['title'];
$id=$row['id'];

$data explode(' recipe',$word); 

echo (
"<br>" $id  ."-<a href=\"$id/\">" $data[0] . "</a>");


?>
__________________
Poker News, articles, discussion
LIKE THIS

Its an iPod, a phone, and an internet communications device.
Last edited by -Ray-; 06-20-2008 at 11:06 AM.
-Ray- is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 10:51 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger