» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > MySQL Forums

MySQL Forums Share Your Ideas and Tips about MYSQL. Ask questions about MYSQL. Table Design and Much More...

Reply
 
Thread Tools Display Modes
  #1  
Old 08-09-2006, 10:34 AM
tipton tipton is offline
OSP Starters
 
Join Date: Aug 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
tipton is on a distinguished road
Default displaying data from a field

hello friends

I am trying to make a hyperlink and an image source reference my sql database.

Lets say the table I am using has 3 fields in it which would be "Name", "MyURL" and "MyImage" hopefully the names of the fields dont matter because I will prolly change them later but for now thats what they are.

Now I want my page to display the following code:

Code:
<a href="<?=$pageheaderurl?>"><img src="<?=$pageheaderimage?>" border="0"></a>

I will have MANY rows in this table for different images and urls but I need to be able to reference one single row and have the link url and image url for a specific name on the page I am working on. It doesnt have to be dynamic in the sense of automaking the pages for this.

For Example:
Name=John
MyURL=http://fakeurl.com/image.jpg
MyImage=http://f -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 08-09-2006, 10:35 AM
raven raven is offline
OSP Starters
 
Join Date: Mar 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
raven is on a distinguished road
Default

Well, first off, the column names do matter, in as much as they can be case sensitive (not so on a Windows platform, usually, but on linux for sure) so referencing the column `name` and `Name` would be two different things.

Secondly, your query would fail because you haven't used quotes around the string you want to compare. In other words, you're looking for any records that have a `name` column where the value is 'John'. Because you've left the quotes out, the queries you've written are literally looking to compare a column `name` with a column `John` (which I'm assuming doesn't exist, so the query returns no result; in fact it should fail).

Third, your calls to mysql_result() reference columns that you haven't named in your query at all, specifically image_url (myimage) and link_url (myurl), and use a seemingly nonexistant variable $i for the row. These values need to be the actual value of columns you've referenced in the SELECT statement. Furthermore, -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Verio Unveils Data Backup Plan outsourcingplans Web Hosting News 0 01-20-2007 03:36 AM
G displaying title data from dmoz armello Google 3 06-20-2006 02:37 PM
GN Data Center Unveils Liquid-Cooled Data Center outsourcingplans Web Hosting Industry 0 05-22-2006 06:57 PM
GN Data Center Unveils Liquid-Cooled Data Center outsourcingplans Web Hosting Industry 0 05-19-2006 07:50 PM
Verio Expands Data Protection & Storage Service Offerings outsourcingplans Web Hosting News 0 12-10-2005 04:30 PM


All times are GMT. The time now is 12:43 PM.