Current location: Hot Scripts Forums » Programming Languages » PHP » Simple Script Required For Simple Man


Simple Script Required For Simple Man

Reply
  #1 (permalink)  
Old 05-20-05, 06:27 PM
thebigman thebigman is offline
New Member
 
Join Date: May 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Simple Script Required For Simple Man

I WAS WONDERING IF SOMEONE COULD POINT ME IN THE DIRECTION OF A SIMPLE SCRIPT THAT I COULD SET UP. I WOULD LIKE TO CREATE A MYSQL FILE AND PRINT OUT THE RECORDS OF CONTACTS IN ALPHABETICAL ORDER ON A PAGE IE A LIST OF LOCATIONS. I HAVE PHP AND MYSQL SPACE BUT NOT VERY MUCH EXPERIENCE IN WEB STUFF. THANKS VERY MUCH
Reply With Quote
  #2 (permalink)  
Old 05-21-05, 12:24 AM
Sabu Sabu is offline
Junior Code Guru
 
Join Date: Sep 2004
Posts: 458
Thanks: 0
Thanked 0 Times in 0 Posts
ucfirst($message)
Reply With Quote
  #3 (permalink)  
Old 05-21-05, 12:32 AM
thebigman thebigman is offline
New Member
 
Join Date: May 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
? whats this
Reply With Quote
  #4 (permalink)  
Old 05-21-05, 08:56 AM
liljoeyjordison liljoeyjordison is offline
Newbie Coder
 
Join Date: Jan 2005
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
Basically, you need to insert all the data you need with a form or with cpanel if you have virtual hosting. Then you need to use
PHP Code:

<?php

// first we need to connect and be using the database
$link mysql_connect('localhost''yourusename''yourpassword')
   or die(
'Could not connect: ' mysql_error());

mysql_select_db('yourdatabasename') or die('Could not select database');


$sql 'SELECT * FROM `tablename`  ORDER BY `columnname` DESC'
/* creates a variable containing SQL syntax- 'ORDER BY' sorts your results.
 You can change the word DESC into ASC if you want to order your results
 the other way around */

$result=mysql_query($sql) or die(mysql_error()); /* executes your query with
 the function mysqk_query(). If this fails it will tell you why */

echo "<table>" //creates a table to put the results in


/* just echoing the $result wont work as this is a resource identifier
 for the whole table, rather than anything legible. So use this code
 which sets up a loop. Just change the html tags when you feel like it */

while ($row mysql_fetch_array($result))
{
echo 
"<tr><td>" ;
print_r($row); # each row is printed inside <tr> and <td> tags
 
echo "</td></tr>" 
}

echo 
"</table>" //ends that table
?>
Looks more complecated then it actually is, just play around and you'll get it
Reply With Quote
  #5 (permalink)  
Old 05-21-05, 02:56 PM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
do not use CAPS next time, please.
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
  #6 (permalink)  
Old 01-05-07, 05:54 PM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
Quote:
Originally Posted by Sabu
ucfirst($message)
Hahahahaha...
__________________
The toxic ZCE
Reply With Quote
  #7 (permalink)  
Old 01-06-07, 12:04 AM
bizzar528's Avatar
bizzar528 bizzar528 is offline
Community Liaison
 
Join Date: Sep 2004
Location: Pennsylvania, US
Posts: 1,550
Thanks: 2
Thanked 16 Times in 15 Posts
sabu had a lot of good responses.
Reply With Quote
Reply

Bookmarks


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2 profitable script sites for sale cms-master.com General Advertisements 3 07-03-07 10:17 AM
Simple Banner Script n00bie Script Requests 0 03-07-05 11:29 PM
looking for simple photo gallery script rookie Script Requests 0 03-01-05 10:38 AM
I most definately suggest DevelopingCentral.com For Any Website Design/Development! Salty777 General Advertisements 2 10-01-04 04:27 AM
Need help with this keyword script - i'm sure it's simple! dudeman248 JavaScript 2 05-19-04 05:11 PM


All times are GMT -5. The time now is 06:45 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.