[PHP-DB] Storing iterated results into various variables

2003-02-04 Thread Geckodeep
May be some one could help me here, I am trying to retrieve results from a
table that gives 9 rows, from each row I am trying to pull out two fields
and assign the two values of those column fields to a variable $image1 and
$caption1, and now I want to go to the next row and pick up the values of
the corresponding fields and store it in the next variable $image2 and
$caption2 and to continue until I reach 9 rows.

The reason for this technique is I am trying to inject the dynamic data
inside a page which is already formatted with HTMLs (kind of template) and
by means of Php tags I can echo these variables where needed.



Thanks for your time and help in advance I'd appreciate it.



GD



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Storing iterated results into various variables

2003-02-04 Thread Geckodeep
Here is a part of my code:

while ($image_row = mysql_fetch_array($result_images)){

$image1 = $image_row[0][image1];

if ($image1 == ){

$image1 = $folder.logo.jpg;// it
places a log when there are no images

}

$caption1 = $image_row[0][caption];

}

This loop fetches the row and assigns the two variables $image1 and
$caption1 with its associated value from the fields in the 1st row.

How can I get the loop to fetch in the same way as above but from the 2nd
row and assigns the values to the new variable $image2 and $caption2 until
it reaches the 9th row with $image9 and $caption9?



thanks again



Jason Wong [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Tuesday 04 February 2003 20:02, Geckodeep wrote:
  May be some one could help me here, I am trying to retrieve results from
a
  table that gives 9 rows, from each row I am trying to pull out two
fields
  and assign the two values of those column fields to a variable $image1
and
  $caption1, and now I want to go to the next row and pick up the values
of
  the corresponding fields and store it in the next variable $image2 and
  $caption2 and to continue until I reach 9 rows.
 
  The reason for this technique is I am trying to inject the dynamic data
  inside a page which is already formatted with HTMLs (kind of template)
and
  by means of Php tags I can echo these variables where needed.

 What exactly are you having problems with? What is your code so far?

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-db
 --
 /*
 Ah, sweet Springtime, when a young man lightly turns his fancy over!
 */




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Storing iterated results into various variables

2003-02-04 Thread Geckodeep
thanks i m going to test ride it and let you know.
tks again to adam  jason.

Adam Voigt [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
$counter = 1;
$query = mysql_query(SELECT image,caption FROM tablename ORDER BY id;);

while($row = mysql_fetch_array($query))
{

$imagevar = image . $counter;
$captionvar = caption . $counter;

$$imagevar = $row[image];
$$captionvar = $row[caption];

$counter++;

}

Change the query to match what you need, and that should work, if
your interested, check out the manual page on Variable Variables at:

http://www.php.net/manual/en/language.variables.variable.php

Enjoy.

On Tue, 2003-02-04 at 07:02, Geckodeep wrote:
May be some one could help me here, I am trying to retrieve results from a
table that gives 9 rows, from each row I am trying to pull out two fields
and assign the two values of those column fields to a variable $image1 and
$caption1, and now I want to go to the next row and pick up the values of
the corresponding fields and store it in the next variable $image2 and
$caption2 and to continue until I reach 9 rows.

The reason for this technique is I am trying to inject the dynamic data
inside a page which is already formatted with HTMLs (kind of template) and
by means of Php tags I can echo these variables where needed.



Thanks for your time and help in advance I'd appreciate it.



GD



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Storing iterated results into various variables

2003-02-04 Thread Geckodeep
finally i got it to work in this manner.

$i=1;
while ($image_row = mysql_fetch_array($result_images)){
$image=image.$i;
$caption=caption.$i;
$$image = $image_row[image1];
if ($$image == ){
$$image = $folder.logo.jpg;
}
$$caption = $image_row[caption];
$i++;
}
great so thanks Adams.

GD


Geckodeep [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 thanks i m going to test ride it and let you know.
 tks again to adam  jason.

 Adam Voigt [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 $counter = 1;
 $query = mysql_query(SELECT image,caption FROM tablename ORDER BY id;);

 while($row = mysql_fetch_array($query))
 {

 $imagevar = image . $counter;
 $captionvar = caption . $counter;

 $$imagevar = $row[image];
 $$captionvar = $row[caption];

 $counter++;

 }

 Change the query to match what you need, and that should work, if
 your interested, check out the manual page on Variable Variables at:

 http://www.php.net/manual/en/language.variables.variable.php

 Enjoy.

 On Tue, 2003-02-04 at 07:02, Geckodeep wrote:
 May be some one could help me here, I am trying to retrieve results from a
 table that gives 9 rows, from each row I am trying to pull out two fields
 and assign the two values of those column fields to a variable $image1 and
 $caption1, and now I want to go to the next row and pick up the values of
 the corresponding fields and store it in the next variable $image2 and
 $caption2 and to continue until I reach 9 rows.

 The reason for this technique is I am trying to inject the dynamic data
 inside a page which is already formatted with HTMLs (kind of template) and
 by means of Php tags I can echo these variables where needed.



 Thanks for your time and help in advance I'd appreciate it.



 GD



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

 --
 Adam Voigt ([EMAIL PROTECTED])
 The Cryptocomm Group
 My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: I want to upload

2003-01-30 Thread Geckodeep
Here are some articles I found on different forums while on uploading files
etc, these should give you a head start.

use the move_uploaded_file ( string filename, string destination)

- the one below is great it explains it in a very simple manner:
How do I find the file I just uploaded to the webserver and load it?

No matter where the file is uploaded, php will store certain variables for
you containing information about the file.  The full path and filename are
located in the variable with the same name as your file form field.
Let's say you called your file upload field Picture and that your Apache
temp directory is /inetpub/tmp/.
In your script, the variable $Picture will contain /inetpub/tmp/1002.tmp
where 1002.tmp is the temporary name of the file uploaded.  The variable
$Picture_name will contain the origional file name.
Performing a copy ($Picture, ./images/ . $Picture_name); will put the
image, proper name and all, in the images directory under the script root.
If the security on the server will not allow you to use the copy command,
try the file commmands to create and write a new file: (fopen, fread,
fwrite).  If the server security will not allow that command either, try
putting the images into a blob or binary field in your database.

-Here is an example of a script i found from some  foroum :
?php

// Complete working file upload example, Win2KPro, Apache 1.3x, PHP 4.x

// Set this line in php.ini
// upload_tmp_dir = /Library/WebServer/yourURL.com/upload_directory/

function handleupload() {
if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {

$realname = $_FILES['userfile']['name'];
print b$realname/b was uploaded successfuly to the upload directory;

print ;

copy($_FILES['userfile']['tmp_name'],
/Library/WebServer/yourURL.com/upload_directory/.$realname);
} else {
echo Possible file upload attack: filename
.$_FILES['userfile']['name']..;
}
}

?
Good luck with it, I my self is a newbie hope it helps you.


GD
Quique Notelodigo [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I want to upload a image, from the client, to the server.

 I use PHP and MySQL and Apache in the server.

 ¿How can I do it?

 _
 Charla con tus amigos en línea mediante MSN Messenger:
 http://messenger.microsoft.com/es




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: I want to upload

2003-01-30 Thread Geckodeep
Well its me again ,you can also check this thread i've posted to get some
more information:
  Help/Advice/Suggestions need to Upload 9 images on one submit button. 

GD
Quique Notelodigo [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I want to upload a image, from the client, to the server.

 I use PHP and MySQL and Apache in the server.

 ¿How can I do it?

 _
 Charla con tus amigos en línea mediante MSN Messenger:
 http://messenger.microsoft.com/es




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Help/Advice/Suggestions need to Upload 9 images on one submit button.

2003-01-27 Thread Geckodeep
Hi,

Can any one guide me through the uploading file procedure please?
Should I use copy() function to copy the image file to a temp file and
rename it to the real name and then reference the name in the data base.
Or is there any other way.
Should say though my Service Provider does not support exec(cp $picture
/full/path/to/joesauto/images/$picture_name) as explained in one of the
article in phpbuilder by Willim Samplonius.
Also I've found other old articles related to this but none of them have
helped me so far to solve my problem.

I've identified the steps to build the page.
1)  Upload and store in to the directory
2)  Get the Url of the image
3)  Store the URL into Mysql table

And later retrieve the image which is my second part.
Having I identified the steps can any one help me how to translate that into
Php please.

I forgot to mention that what I am uploading, which in this case are 9 Jpeg
images.
Which should be uploaded together with one submit button.
The table is as follows:
Image_tbl
ID|Caption|ImgFileName|
This Image_tbl is related to an Article table
Art_tbl
ID|Title|Article|

So as you can see that 9 images are related to an article and one thing is
sure there are always 9 images for each article.


Thanks

GD



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Uploading and displaying Jpeg images through Path reference /text from mysql

2003-01-24 Thread Geckodeep
Hello There,
I wondered if any one could help me with this problem.
I am helping a friend with his web site which is a content management
system. to tell you the truth i am a beginner in Php/Mysql and this is my
first experience.
The table is called REPORT and it has a Field for REPORT_Title another for
The REPORT itself and 9 fields to upload IMAGES with 9 corresponding fields
to describe the 9 images.
This REPORT table is linked to another Table for categories called CAT to
choose the catagorie.

The question is how will i put this to gether, I have spend my whole day
looking for answer. Due to Size limitation 4Go per table in MySql, I chose
not to insert as binary(BLOB) instead Through path reference of the image.As
it's possible to insert hundreds of articles with images. To be on the safe
side i prefer to use the Path reference techniques.

I thank you'll in advance for your advice.

GD



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php