RE: [PHP-DB] Retrieving Image Location in MySQL
Sashi, This (likely) means you have a some generic page (i.e., picture.php) that displays some picture. The picture it displays depends on the parameter passed when the page is called (i.e., 123). html head titleSashi's Test Page/title /head body ?php $value = $_GET ['qry']; //Get your parameter if (!$value) die(Uh oh, trying to call the page without a valid qry value.); //Write a query to pull out the picture's path $sql = SELECT path FROM Image WHERE ID = %s; mysql_real_escape_string($value); //Execute the query $output = mysql_query($sql); //Display the corresponding picture while ($row = mysql_fetch_assoc($output)) { printf(img src=\%s\ /, $row['firstname']); } //Clean up mysql_free_result($output); ? /body /html Please note, I haven't tried this. It just seems plausible. Good luck. A- -Original Message- From: Sashikanth Gurram [mailto:sashi...@vt.edu] Sent: Sunday, March 01, 2009 10:27 PM To: php-db@lists.php.net Subject: [PHP-DB] Retrieving Image Location in MySQL Dear All, I am trying to retrieve the location of a image (not the image, just the location of the image) stored on MySQL database, using PHP to display it in my browser. One of the users has been kind enough to provide me with an example code as to how to do it. He asked me to use /img src=picture.php?qry=123 /in the html code. I understood the part of /picture.php? /which tells us that the php code used to retrieve the image is located in the file picture.php (If what I have understood is correct). But I did not quite understand the second part /qry=123 /. What does this mean? Of what use is this second part? Does the variable qry has something assigned to it in the picture.php code? I would greatly appreciate it if any one of you can answer my questions. Thanks, Sashi -- ~ ~ Sashikanth Gurram Graduate Research Assistant Department of Civil and Environmental Engineering Virginia Tech Blacksburg, VA 24060, USA -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Retrieving Image Location in MySQL
Fortuno, Adam írta: //Write a query to pull out the picture's path $sql = SELECT path FROM Image WHERE ID = %s; mysql_real_escape_string($value); Sorry, but this won't work, since you don't map the value of the escaped $value to the %s, lets say with sprintf()... Regards, Matya -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Retrieving Image Location in MySQL
Matya, Ha, ha, ha! Thank you good friend. I did say I didn't try the code :-) AF Please note, I haven't tried this. It just seems plausible. I apologize if I confused anyone. I just meant to show how the parameter could help retrieve a picture. I wasn't too concerned with the particulars. Hopefully the concept is sound. If not, please do flame my note so no one attempts it. Be Well, A- -Original Message- From: Mattyasovszky Janos [mailto:m...@matya.hu] Sent: Monday, March 02, 2009 9:29 AM To: php-db@lists.php.net Subject: Re: [PHP-DB] Retrieving Image Location in MySQL Fortuno, Adam írta: //Write a query to pull out the picture's path $sql = SELECT path FROM Image WHERE ID = %s; mysql_real_escape_string($value); Sorry, but this won't work, since you don't map the value of the escaped $value to the %s, lets say with sprintf()... Regards, Matya -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] FTP functions and upload limit.
Ardilla Roja wrote: Hi to everybody, I tried to find an answer in the php sites, but wasn't able to... Does the php.ini upload_max_filesize affects the ftp_put function ?... No. upload_max_filesize is to do with how much your browser can upload to the website. ftp_put may have a limit - but that will be on the remote ftp site, nothing in php has anything to do with that. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Retrieving Image Location in MySQL
Hello guys, Thanks to you all for your kind replies. I will try the steps and get back to you if I encounter more problems. Thanks, Sashi Fortuno, Adam wrote: Matya, Ha, ha, ha! Thank you good friend. I did say I didn't try the code :-) AF Please note, I haven't tried this. It just seems plausible. I apologize if I confused anyone. I just meant to show how the parameter could help retrieve a picture. I wasn't too concerned with the particulars. Hopefully the concept is sound. If not, please do flame my note so no one attempts it. Be Well, A- -Original Message- From: Mattyasovszky Janos [mailto:m...@matya.hu] Sent: Monday, March 02, 2009 9:29 AM To: php-db@lists.php.net Subject: Re: [PHP-DB] Retrieving Image Location in MySQL Fortuno, Adam írta: //Write a query to pull out the picture's path $sql = SELECT path FROM Image WHERE ID = %s; mysql_real_escape_string($value); Sorry, but this won't work, since you don't map the value of the escaped $value to the %s, lets say with sprintf()... Regards, Matya -- ~ ~ Sashikanth Gurram Graduate Research Assistant Department of Civil and Environmental Engineering Virginia Tech Blacksburg, VA 24060, USA -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php