Results 1 to 4 of 4

 

Thread: php scripts to display data from MySql

  1. #1
    accelerator's Avatar
    Online shopping rocks!

    Status
    Online
    Join Date
    Nov 2004
    Location
    England
    Posts
    3,035
    Thanks
    54
    Thanked 183 Times in 164 Posts


    Dear All

    I am presently working on php scripts to display data from a MySql database containing data from xml product feeds.

    Are there any good ready made scripts out there? The kind of things I will be needing are:
    - display by product name
    - display by category
    - sort by price
    - sort by brand
    - search database
    etc etc

    Just wondered if any one could point me in the direction of some ready to go scripts that I could use/adapt instead of creating my own from scratch.

    Many thanks

    Accelerator

  2. #2
    Super Member

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Costa Del Sheffield
    Posts
    2,838
    Thanks
    5
    Thanked 18 Times in 14 Posts
    its not that hard just depends what query you run and how you sort the data is up to you

    if your using phpMyAdmin you can sort the data how you want in there and it will show you the php qry

    so like:

    $result = mysql_query("SELECT * FROM database_table_name WHERE category = 'Category_Name' ORDER BY price desc LIMIT 0, 30") or die("Database Error" . mysql_error());

    would get the data for all products in the table called "database_table_name" if the category of the product is "Category_Name" and sort the data by the field called price descending (alternative is asc - ascending) and the limit will only get 30 results.

    then do a while statement to loop through and echo out what you want

    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
    echo "$row[product_name]<br>";
    }

    that would just print out 30 of the product names (presuming you have a field called product_name) from category Category_Name with the highest prices.

    loads of different ways to display the data between the while statement and lots of different data you can return with the $result depending on what you want


    and thats the last bit of help im giving this year
    Dan Morley
    alpharooms.com
    daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
    My Blog | Cheap Holidays

  3. #3
    accelerator's Avatar
    Online shopping rocks!

    Status
    Online
    Join Date
    Nov 2004
    Location
    England
    Posts
    3,035
    Thanks
    54
    Thanked 183 Times in 164 Posts
    Thanks morleymouse, appreciated.

    I'm still looking at this general area, and have been looking around for php scripts for searching MySql databases, tutorials, techniques etc etc.

    Has anyone got any good urls they can point me at? I'm finding it difficult tracking down good examples.

    Cheers

    Accelerator

  4. #4
    Registered User

    Status
    Offline
    Join Date
    Dec 2005
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by accelerator
    Thanks morleymouse, appreciated.

    I'm still looking at this general area, and have been looking around for php scripts for searching MySql databases, tutorials, techniques etc etc.

    Has anyone got any good urls they can point me at? I'm finding it difficult tracking down good examples.

    Cheers

    Accelerator
    Well I got pissed off with phpmyadmin cos I had problems inserting new rows when some fields were of data-type TEXT.

    So I downloaded a full-on mysql server management application http://enginsite.com/MySQL-client-ma...-for-MySQL.htm

    Free for 30 days eval. Its rather slick, user-friendly and full-featured.

    As for php resources try http://www.phpfreaks.com or http://www.phpbuilder.net and of course http://www.php.net/manual/en/

    Regs

    Jimbo



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. mysql / php / insert data into many tables
    By morleymouse in forum Programming
    Replies: 9
    Last Post: 05-01-05, 03:46 PM
  2. Inserting Data in MySQl
    By DaveR in forum Programming
    Replies: 2
    Last Post: 13-10-04, 04:16 AM
  3. Anyone anygood with xml, php, mysql and Affiliate Window
    By AnnonnyMouse in forum Affiliate Marketing Lounge
    Replies: 1
    Last Post: 23-09-04, 11:00 AM
  4. data feeds with php
    By Peter Skellen in forum Programming
    Replies: 1
    Last Post: 09-10-03, 08:45 PM
  5. PHP & MYSQL
    By Affiliates4u in forum Programming
    Replies: 8
    Last Post: 13-01-03, 08:12 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2