Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
New to MySQL/PHP - Link image
Old 10-21-2010, 08:03 PM New to MySQL/PHP - Link image
Skilled Talker

Posts: 87
Location: New York
Trades: 0
What I am trying to do is link my gallery and blogs on here, so I need to some how in the database insert a link to that I can click on the images to go a specific page.


ADDED: ALSO I need to format the dates on here, I am using Date in the database and I can not figure out how to format it to (ex. 10-21-2010)

This is the page
http://lettersfromlegends.com/node/3

this is what I have now
PHP Code:
$result mysql_query("SELECT * FROM Basketball ORDER BY DateReceived")
or die(
mysql_error());  

echo 
"<table border='0'>";
echo 
"<tr> <th>Player's Name</th> <th>Date Sent</th> <th>Date Received</th><th>Sent</th> <th>Recieved</th> <th>Letter</th><th>Photo</th> <th>Blog</th> </tr>";
// 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['FirstName'] . " " $row['LastName'];
    echo 
"</center></td><td><center>"
    echo 
$row['DateSent'];
    echo 
"</center></td><td><center>";
    echo 
$row['DateReceived'];
    echo 
"</center></td><td><center>";
    echo 
$row['ItemsSent'];
    echo 
"</center></td><td><center>";
    echo 
$row['ItemsReceived'];
    echo 
"</center></td><td><center>";
    echo 
$row['Letter'];
    echo 
"</center></td><td><center>";
    echo 
$row['Photo'];
echo 
'<img src="http://www.lettersfromlegends.com/misc/ico_photo.gif" width="30" height="26" />';
    echo 
"</center></td><td><center>";
    echo 
$row['Blog'];
echo 
'<img src="http://www.lettersfromlegends.com/misc/blog.jpg" width="28" height="24" />';
    echo 
"</center></td></tr>"
    



echo 
"</table>";


?> 

Last edited by NYChaoS; 10-21-2010 at 08:05 PM..
NYChaoS is offline
Reply With Quote
View Public Profile Visit NYChaoS's homepage!
 
 
Register now for full access!
Old 10-22-2010, 07:12 AM Re: New to MySQL/PHP - Link image
Skilled Talker

Posts: 52
Trades: 0
I'm sorry I didn't understand what do you want to do. I would help you,I'm waiting for your reply.

Regards.
webmastertalker is offline
Reply With Quote
View Public Profile
 
Old 10-22-2010, 07:26 AM Re: New to MySQL/PHP - Link image
Skilled Talker

Posts: 87
Location: New York
Trades: 0
Goto http://lettersfromlegends.com/node/3

1) I need to format the date so it shows 10-22-2010, the date is coming from a MySQL database using the Date function.

2) For each database entry there will be a separate blog post, photo and letter as you can see on the page their are the 3 images. I need put different links on each of those images and I was wondering if there is a easy way of doing that in MySQL. If not I can always insert <a href="http://www.sgsdgs.com/"> in to each mysql field

Last edited by NYChaoS; 10-22-2010 at 07:31 AM..
NYChaoS is offline
Reply With Quote
View Public Profile Visit NYChaoS's homepage!
 
Old 10-22-2010, 04:03 PM Re: New to MySQL/PHP - Link image
Skilled Talker

Posts: 52
Trades: 0
Quote:
Originally Posted by NYChaoS View Post
Goto http://lettersfromlegends.com/node/3

1) I need to format the date so it shows 10-22-2010, the date is coming from a MySQL database using the Date function.

2) For each database entry there will be a separate blog post, photo and letter as you can see on the page their are the 3 images. I need put different links on each of those images and I was wondering if there is a easy way of doing that in MySQL. If not I can always insert <a href="http://www.sgsdgs.com/"> in to each mysql field

1) So for the date format you have to redefine the function in this way:
PHP Code:
date("m/d/Y"); 
nothe the format m/d/Y is the key to show it as "10-22-2010" ...

2) For every player name you have to create also the fields for letter, blog and photo url... in your mysql database.

feel free to ask other explantions
webmastertalker is offline
Reply With Quote
View Public Profile
 
Old 10-22-2010, 08:32 PM Re: New to MySQL/PHP - Link image
Skilled Talker

Posts: 87
Location: New York
Trades: 0
as far as the date goes how do i change it, its not a columntype option in MySQL so what query would i type in there to change it?
NYChaoS is offline
Reply With Quote
View Public Profile Visit NYChaoS's homepage!
 
Old 10-23-2010, 05:53 AM Re: New to MySQL/PHP - Link image
Banned

Posts: 1
Name: Alessio
Trades: 0
Probably you mean something like this?

PHP Code:
$today date("Y-m-d");
mysql_query("UPDATE Basketball SET DateField = '$today' WHERE ... "); 
xyzale is offline
Reply With Quote
View Public Profile Visit xyzale's homepage!
 
Reply     « Reply to New to MySQL/PHP - Link image
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.32865 seconds with 12 queries