Help Importing Mysql Database Results - Need help formatting link

free web hosting
Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

Help Importing Mysql Database Results - Need help formatting link

candicej
I am having trouble formatting my table to display the results of a mySQL query the way I want.

Here is the part of my code:

CODE
$result = mysql_query("SELECT * FROM uploads WHERE Category='Drama'")
or die(mysql_error()); ?>
<table cellspacing="2" cellpadding="2">
<tr> <th>Title</th> <th>Author</th> <th>File</th></tr>
<?php
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
//<!--Print out the contents of each row into a table-->
echo "<tr><td>";
echo $row['Title'];
echo "</td><td>";
echo $row['Author'];
echo "</td></tr>";
echo $row['File'];
echo "</td></tr>";
}
echo "</table>";


I want to make 'Title' show as a hyperlink to 'File' but am at a loss as to how to do this. I have tried all I know so any help is appreciated. I am very new to php and mySQL.

Thanks in advance,
C

 

 

 


Reply

cse-icons
The following should help.. though I have not tested it.. as I dont have php configured on my system...


CODE
echo "<tr><td><a href=\"";
echo $row['File'];
echo "\">"
echo $row['Title'];
echo "</a>"
echo "</td><td>";
echo $row['Author'];
echo "</td></tr>";


Cheers.

Reply

Newton
You have an extra </tr> and are missing a <td>. The corrected code should be:

CODE
result = mysql_query("SELECT * FROM uploads WHERE Category='Drama'")
or die(mysql_error()); ?>
<table cellspacing="2" cellpadding="2">
<tr> <th>Title</th> <th>Author</th> <th>File</th></tr>
<?php
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
//<!--Print out the contents of each row into a table-->
echo "<tr><td>";
echo $row['Title'];
echo "</td><td>";
echo $row['Author'];
echo "</td><td>";
echo $row['File'];
echo "</td></tr>";
}
echo "</table>";


 

 

 


Reply

candicej
Thank you both. Thanks to your help I now have it working wonderfully. I appreciate it greatly!

candicej

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : importing, mysql, database, results, formatting, link

  1. How To Use A Database For Chess Results?
    How to set-up, configure, and utilize a database to store chess result (0)
  2. Creating A Php Login System Using Mysql
    I need help in creating a login system, what I want is a login system (9)
    Hey everyone! I am helping someone make a login system using MySQL databases and a PHP login
    form. I have a fair bit of experiance in HTML and some javascript too. I have virtually no
    experiance in MySQL or PHP. Anybody know of any good PHP login systems that allow you to creat a
    personalised page for each user and when they login the system transfers the user to their page.
    Another thing that the system MUST have is a way of stopping unwanted users entering someones page.
    CODE For example lets say I register and my UN is jesse123 and my personalised pages a....
  3. Mysql Database Not Working
    (3)
    well i'm getting an error message(a databass connection warning) for all of the parts of my site
    that connects to a mysql database i check my database users pertmissions and i try to do the repair
    database thing and it's still not woeking. am i the only person having this or is it an overall
    trap17 issue and how do i fix it.....
  4. Ips Installer Database Details [resolved]
    It wont accept localhost... (6)
    CODE Access denied for user 'skyed211_central'@'localhost' to database
    'skyed211_centralgaming' I get this error message when trying to install my IPB. It will
    not accept localhost, nor mysql. Can I get any help please? I've tried many times to get past
    this part, but it's not happening /sad.gif" style="vertical-align:middle" emoid=":(" border="0"
    alt="sad.gif" />....
  5. The Only Reason I Choose Ms Sql Server Rather Than Mysql
    (0)
    The only reason i choose ms sql server rather than mysql is, MS SQL has more security
    features!! MySQL is lacking a lot in my opinions - Lack in wide char, like nvarchar, I
    developed some application to support chinese letter, and dont know how to build one in mysql - Lack
    in t-sql syntax, like query in query is not fully supported - Does not have today SQL features like
    BI support (today really required) And compare MS SQL to MySQL, the only reason why mysql is
    favourable is - it is free! Dont u guys agree?....
  6. An Error Thought I'd Let The Admins Know About.
    Bad link. (4)
    Upon my creation with the forums, I noticed that I got a little info box almost at the top, telling
    me my credit value towards obtaining the free default package hosting. Upon reading this I noticed
    that the last paragraph with "computer hosting" the link to there site is not working. Clicked it a
    few times just to make sure it wasn't my connection. Unfortunately it isn't. I just thought
    I could help out with that, as its not exactly working, and I am some what interested in it. ^.^
    Thank you and take care. /smile.gif" style="vertical-align:middle" emoid=":)"....
  7. Need Advice On Setting Up Mysql Database.
    I have a huge amount of daily data updates to be inserted. (3)
    First of all, to get the idea of what I am trying to achieve here, please have a look at my
    idea thread, entitled Idea For Using A Cron Job To Grab Daily Travian Map.sql Updates . This gives
    a prelude to the project, what it is for, what it is supposed to do, etc. Now, what I need is
    specific advice on setting up the mySQL database(s) to implement this idea. There is a useful FAQ
    file for how to make use of the map.sql data located on the help.travian.com website, which also
    gives an example of the CREATE TABLE instruction that matches the data in the map.sql fi....
  8. Mysql Db Is Down Getting Following Error
    (2)
    My Mysql is Down can I get some help please? Appreciate it. Patrick Domain: patrickcurl.com Error:
    phpMyAdmin - Error #2002 - The server is not responding (or the local MySQL server's socket is
    not correctly configured)....
  9. It Went Well For A While
    MySQL problem back in all its glory. (5)
    Some time ago I had a stubborn problem when trying to access one of the interactive pages on my
    website and getting the following error: QUOTE Warning: fopen() : open_basedir restriction in
    effect. File(include/errors.xml) is not within the allowed path(s):
    (/home/mrdee:/usr/lib/php:/usr/local/lib/php:/tmp) in
    /home/mrdee/public_html/admin/include/commonfunctions.php on line 682 Warning:
    fopen(include/errors.xml) : failed to open stream: Operation not permitted in
    /home/mrdee/public_html/admin/include/commonfunctions.php on line 682 Cannot open XML data file:
    incl....
  10. Soa Architecture
    forum about SOA Architecture, SOA Metodology, tips, link and so on (0)
    Hi *, Is there anybody who deals with SOA and focused on SOA Metodology ? P.S. Any link would be
    appreciated. BRs, M.....
  11. Need Help With My Database [resolved]
    retrive data as a link (6)
    This is the situation: I have a database where you can add bands ( theire albums, genre other
    info) For the album part they can add for each album the songs. So what do i want: When i show
    the results there only shoul display the bandname which should be a link to the more detailed info
    like albums biography etc. How do I do that. Is there a name for this and are there any
    tutorials. thx in advance....
  12. Is The Database System Gone Again? [resolved]
    Errors on PHPMyAdmin again (12)
    I wonder if there is a problem with the PHPMyAdmin system again? When trying to get into it, I once
    again get the following: QUOTE Warning: session_write_close() : SQLite: session write query
    failed: database is full in /usr/local/cpanel/base/3rdparty/phpMyAdmin/index.php on line 42
    Warning: session_write_close() : Failed to write session data (sqlite). Please verify that the
    current setting of session.save_path is correct
    (/var/cpanel/userhomes/cpanelphpmyadmin/sessions/phpsess.sdb) in
    /usr/local/cpanel/base/3rdparty/phpMyAdmin/index.php on line 42 Warning: Ca....
  13. Database Or Pdf
    Best way to list books on my site (3)
    Hi all, I am not sure if this is the right place to post but I'm sure you'll tell
    me if it's not. My problem is this: I have a website where I sell books and it's one of
    those simpleton sites where I don't need to know code, I just click icons etc Anyway, I can
    upload images to the server and need to have them in different resolutions and link from a thumbnail
    to the larger picture. What I am trying to say is I have about 6000 books to display on my
    website which is impractical as it takes me about 10 mins to load 1 copy. What is the ....
  14. How Do I Find My Mysql Password? [resolved]
    Cannot access my MySQL (5)
    After all the recent problems, my account has been restored. I have setup my parked domain agin, and
    that works fine. However, I can no longer access my MySQL databases (I can from PHPMyAdmin, but
    that's all). I had to create a new user for my databases, and created the user with exactly the
    same username and password I had before, but some of my web pages do not let me access the pages I
    have associated with my databases. Where could i find out what my DB password is? (Although I am as
    good as sure I am using the right one). I have tried my old password, the new c....
  15. Dreamweaver Cs3: How To Link Content To Layers/apdivs
    (5)
    Hi all! I've been searching the internet like crazy but just can't find any answers to
    my problem. I want to make it so that my navigation buttons links content to be loaded inside a
    smaller layer/apDiv or perhaps something i've yet to discover. I just can't for my life
    understand how to do this nor what tools and options to use. I am using Dreamweaver CS3 in design
    mode and have no clue how to hard code in html, CSS etc.. Here's a picture of what i want to
    do. I really hope someone can help me or perhaps atleast point me in the right direction....
  16. Phpmyadmin
    Create new database: No Privileges (7)
    i can not make a sql for diff srcipt, but the sricpt i have is php, DJ-cpanel.. all tho i can not
    install it the error is like this Creating Database Tables No database selected there a mysql
    database is made, but i can not use it for othere stuff... plz note that this is Free script and not
    for paid.. is there a way that the myqsul can not use sql other scripts? or it maybe not working...
    but i am not sure if the script not working or it can be the server may be down on mysql...? ....
  17. Html Form!
    Using MySQL?! (4)
    Hey, I need your help again! I need some good working tutorial how I can update my SQL through
    HTML form. I did use some tutorials online found with the help of google; but they do not work
    properly; I mean there are still small mistakes. I need to have a good tutorial to follow. It
    should be based on security and more things. It has to be done in proper way.......
  18. Mysql, Php, Apache Downloads And Setup Was A Nightmare
    Mysql, PHP, Apache (10)
    Mysql, PHP, Apache downloads were easy enough. Then came the setup process. This seemed to be an
    endless mess of going back and forth trying to get the programs to work together properly. Finaly I
    got them working after about 48 hours. There are great tutorials on the setup process, but only one
    or two actualy were easy enough for me to understand. I would like to see if I was the only one who
    had issues with this setup. Are there easier ways to setup the three?....
  19. Mysql-essential-5.0.51 Installion Problem
    please help me.(urgent) (2)
    Dear friend, please help me. Iam working on php project (matchmaking site). I have downloaded mysql
    essensial 5.0.51. When i was installing mysql 5.0.51, i got following error - Error 1901: Error
    attempting to read from the source installation database:
    c:\windows\installer\527ec6.msi What is solution of this problem ? Iam using
    windows xp professional version 2002 (service pack 2). Please post your reply. Iam waiting for your
    answer. ....
  20. Database With Mysql++
    getting mySQL++ to work with trap17 (7)
    Hi, I'm trying to build an online game and figured the easiest way to do the server list would
    be to make a mySQL database for it; however, I use the con() command on the IP i get from pinging my
    website and I always get an abnormal program termination; however, it will work with the mySQL on my
    own machine. The code is below: CODE #include <iostream> #include <iomanip>
    #include <mysql++> #include "pass.h"//holds my password (i program at
    school) int main(void) {     Connection con("t3jem3_test","....
  21. Mysql Won't Update
    (4)
    Ok, so I'm making some arcade administration software so I don't have to add games the hard
    way, well anyway, one of the features I have is that on the homepage is a featured author and as
    such I just have it so it updates one line in the mySQL. Well, the page with the form passes on the
    varibles fine and the updating page recieves them because I echoed everything, then I build the
    query and I even echo the query and it comes out exactly how I want it to, but for some reason, the
    database itself won't update even though all the varibles are there. Here's....
  22. Qupis : Free Hosting With Php, Mysql, Cpanel. (one Line Text Ad At Bottom)
    a member of Xisto (41)
    Hello Members, We are proud to introduce a new member to Xisto group of sites.
    Qupis : Free Web Hosting 150 MB space, 5000 MB Bandwidth, php,
    mysql, CPanel (Latest). Emails, FTP, Addon domains, Parked Domains etc.
    http://www.Qupis.com
    Feel free to add your reviews and comments about it. -Trap17
    Management ....
  23. Subquery In Mysql
    (5)
    Is there anyway to make subqueries work in MySQL? I'm pretty certain someone out there knows
    how. /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /> Can anyone help?
    CODE Select * from ITEMS where ID="Select Max(ID) from ORDERS"; This works
    for MSAccess and SQL Server but why not in MySQL? I'll be writing some reports and I've
    shifted database from MSAccess to MySQL. Help! Thanks.....
  24. Connect To Remote Oracle Database With Toad
    i'm lost (7)
    Hey gang, long time no see, my bad! Anyway, I got me a question. Does anybody know how to
    connect to a remote oracle database using toad? When I read the docs for toad I get the impression
    that I have to have a local oracle installation in order to use toad, but that just seems silly. I
    guess I'm stuck at the point of trying to figure out how to tell toad where to look for all of
    the configuration information it needs for the connection if I don't have any "Oracle Home"
    directories. :crosses fingers: Peace!....
  25. Import From Excel File Into Mysql Database
    (9)
    Has anyone tried using the excel import function that comes with phpmyadmin
    http://www.phpmyadmin.net/home_page/ - it does not require any additional plug-ins or scripts and
    is fairly straightforward to use. In phpmyadmin, if you click on the database table which you wish
    to import the data to , there is a link on the bottom left corner which says "insert data from a
    text file into the table" - although it says text file it still can be used to import an excel file.
    When you click on this link you will be taken to a page where you will be asked for the file name
    (the....
  26. Increment A Mysql Column
    how to increment a MySQL column one unit (7)
    Hi, I have a column in a MySQL table which contains a counter of the views of the object described
    by this table. I would like to increment this value by one everytime the object is viewed. Obviously
    came into my mind the possibility of retrieving the value of this field, store it in a variable
    increment this value by one and perform an UPDATE query again with this new value. My question is if
    there is a MySQL option to update the field with its actual value plus an unit increment. I hope you
    understand the issue.....
  27. Linking A Url To A Button
    How to Link a URL using getURL() (3)
    Linking a URL to a Button in Flash This seems to be a problem for beginners to Flash, and I
    thought I'd address it. When building a Flash-navigated site, you need to link one page to
    another through the flash interface, just like you would a my link in HTML/XHTML. Once
    you've created your button on the page, you can link the button very simply. Right-click it, and
    select "Actions" from the menu. This will open the ActionScript editor, in which you can right
    ActionScript code. Don't worry. It's not detailed to put this link in. Make sure you are i....
  28. Complete Login System
    With PHP + MYSQL (57)
    Its an complete login sistem made and tested by me and I think itwill be very usefull for people who
    are tryn to learn PHP. First, let's make register.php: CODE <?
    include("conn.php"); // create a file with all the database connections
    if($do_register){ // if the submit button were clicked if((!$name)
    || (!$email) || (!$age) || (!$login) ||
    (!$password) || (!$password2)){ print "You can't let
    any fields in blank....
  29. Mysql Database Setup : Setting Up Mysql Database
    Guide to use MySQL database in your site (6)
    A SMALL INTRODUCTION TO DATABASE ============================= I have seen that many members have
    problems with Database. Here is a small INFO which should give you the IDEA. mySQL is a DATABASE
    server. You can access it using the link in Cpanel. Cpanel can be accessed by
    "www.YOUR-SITE.com/Cpanel" There you have 4 Main Options :- 1> CREATE A DATABASE 2> CREATE A USER
    3> ADD USER TO DATABASE 4> PHPMYADMIN CREATE : IT ALLOWS YOU TO CREATE A DATABASE CREATE USER
    : IT ALLOWS YOU TO CREATE A USER. USING THIS, YOU CAN ACCESS THE DATABASE. A DATABASE CANNOT BE....
  30. ZELDA and LINK
    (31)
    Ok here's something that bothers me. There's lots of people that say that zelda and link
    have some kind of romantic thing going on. I always imagined link just being her hero and that their
    relationship was strictly platonic. I mean, i always saw link as a completely pure person that
    doens't really have romantic feelings but only want to save her because it's the valient
    thing to do. .. also he's the legendary hero. .. it's in his blood. Someone argued that they
    do have a relationship because she kissed him in part two on the cheek when he saved h....

    1. Looking for importing, mysql, database, results, formatting, link

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for importing, mysql, database, results, formatting, link

*MORE FROM TRAP17.COM*
Similar
How To Use A Database For Chess Results? - How to set-up, configure, and utilize a database to store chess result
Creating A Php Login System Using Mysql - I need help in creating a login system, what I want is a login system
Mysql Database Not Working
Ips Installer Database Details [resolved] - It wont accept localhost...
The Only Reason I Choose Ms Sql Server Rather Than Mysql
An Error Thought I'd Let The Admins Know About. - Bad link.
Need Advice On Setting Up Mysql Database. - I have a huge amount of daily data updates to be inserted.
Mysql Db Is Down Getting Following Error
It Went Well For A While - MySQL problem back in all its glory.
Soa Architecture - forum about SOA Architecture, SOA Metodology, tips, link and so on
Need Help With My Database [resolved] - retrive data as a link
Is The Database System Gone Again? [resolved] - Errors on PHPMyAdmin again
Database Or Pdf - Best way to list books on my site
How Do I Find My Mysql Password? [resolved] - Cannot access my MySQL
Dreamweaver Cs3: How To Link Content To Layers/apdivs
Phpmyadmin - Create new database: No Privileges
Html Form! - Using MySQL?!
Mysql, Php, Apache Downloads And Setup Was A Nightmare - Mysql, PHP, Apache
Mysql-essential-5.0.51 Installion Problem - please help me.(urgent)
Database With Mysql++ - getting mySQL++ to work with trap17
Mysql Won't Update
Qupis : Free Hosting With Php, Mysql, Cpanel. (one Line Text Ad At Bottom) - a member of Xisto
Subquery In Mysql
Connect To Remote Oracle Database With Toad - i'm lost
Import From Excel File Into Mysql Database
Increment A Mysql Column - how to increment a MySQL column one unit
Linking A Url To A Button - How to Link a URL using getURL()
Complete Login System - With PHP + MYSQL
Mysql Database Setup : Setting Up Mysql Database - Guide to use MySQL database in your site
ZELDA and LINK
advertisement



Help Importing Mysql Database Results - Need help formatting link



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE