![]() |
PHP - Trying to retrieve a value from Mysql db
Hi
I have a table in mysql called tbl_picture_link which stores a url string to some pictures not I would like to retieve the string and place <img> around it. This is the function I have PHP Code:
Any ideas what could be wrong. |
Re: PHP - Trying to retrieve a value from Mysql db
You're missing out a step. Even though you have one row, you still need to fetch the result, not just link to the query. So something like this:
PHP Code:
|
Re: PHP - Trying to retrieve a value from Mysql db
This won't help...
Quote:
edit: heh, ok. what he said ^^^ :D |
Re: PHP - Trying to retrieve a value from Mysql db
oh yes now I see. Thanks its working just one more question how can I use a relative url in a img tag?
This is my web folders are constructed my root is htdocs i then have a websites folder which has another our_website folder which has all my php files under it. I then have /images/pix folder under our_website my images are displaying if I use <img src"/websites/our_website/images/familypix/image.jpeg"/> Is there a way I could shorten this to something like /images/familypix/image.jpeg So if I ever move/rename the our_website folder it will not affect it. |
Re: PHP - Trying to retrieve a value from Mysql db
You can, just drop the first /
like: images/familypix/image.jpeg |
Re: PHP - Trying to retrieve a value from Mysql db
thanks working 100%, a shiney is on its way.
|
| All times are GMT. The time now is 01:40. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum