On Tue, 16 Jun 2009 08:50:45 -0400, PJ wrote:
Ashley Sheridan wrote:
On Mon, 2009-06-15 at 17:38 -0400, PJ wrote:
Then I have to add some loopy thing to assign the values to the
$variables... a real pita since my variable do not lend themselves too
well to linear alterations ($varIn,
Nisse Engström wrote:
On Tue, 16 Jun 2009 08:50:45 -0400, PJ wrote:
Ashley Sheridan wrote:
On Mon, 2009-06-15 at 17:38 -0400, PJ wrote:
Then I have to add some loopy thing to assign the values to the
$variables... a real pita since my variable do not lend themselves too
PHP, tomorrow Java, after the world.
Kyou wa PHP, ashita wa Java, sono ato sekai desu.
To: php-general@lists.php.net
From: news.nospam.0ixbt...@luden.se
Date: Thu, 18 Jun 2009 14:17:59 +0200
Subject: Re: [PHP] how to extract fields from associative array into
different variables
On Tue
On Mon, 2009-06-15 at 17:38 -0400, PJ wrote:
Jay Blanchard wrote:
[snip]
In what way would this simplify or ease my pain?
The difficulty, it seems to me, is not in retrieving the rows, but
rather how to pass the row data to the variables. And since the number
of rows is variable, I
you dont have an alternative. you will have to loop because
mysql_fetch_* functions fetch only one row at a time.
you can use variable variables to achieve the above result (you will
not require this if u use list() or extract() functions)
On 15 June 2009 18:07, PJ advised:
Is there an easier or simpler way to do this?
code:
$sql = SELECT first_name, last_name, book_author.ordinal
FROM author, book_author
WHERE book_author.bookID = $idIN book_author.authID =
author.id
ORDER BY ordinal;
$author = array();
Ashley Sheridan wrote:
On Mon, 2009-06-15 at 17:38 -0400, PJ wrote:
Jay Blanchard wrote:
[snip]
In what way would this simplify or ease my pain?
The difficulty, it seems to me, is not in retrieving the rows, but
rather how to pass the row data to the variables. And since the number
Ford, Mike wrote:
On 15 June 2009 18:07, PJ advised:
Is there an easier or simpler way to do this?
code:
$sql = SELECT first_name, last_name, book_author.ordinal
FROM author, book_author
WHERE book_author.bookID = $idIN book_author.authID =
author.id
ORDER BY
I'm going to assume that your table is setup to have the rows BookID and
AuthorName, adjust accordinging:
function makeInsertQuery(array $authors, $bookId) {
$sql = INSERT INTO book_authors (BookID, AuthorName) VALUES ('$bookId', ';
foreach($authors as $author) {
$author =
On 16 June 2009 13:58, PJ advised:
Ford, Mike wrote:
On 15 June 2009 18:07, PJ advised:
Is there an easier or simpler way to do this?
code:
$sql = SELECT first_name, last_name, book_author.ordinal
FROM author, book_author
WHERE book_author.bookID = $idIN
Ford, Mike wrote:
On 15 June 2009 18:07, PJ advised:
Is there an easier or simpler way to do this?
code:
$sql = SELECT first_name, last_name, book_author.ordinal
FROM author, book_author
WHERE book_author.bookID = $idIN book_author.authID =
author.id
ORDER BY
[snip]
Is there an easier or simpler way to do this?
[/snip]
http://us2.php.net/manual/en/function.mysql-fetch-row.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jay Blanchard wrote:
[snip]
Is there an easier or simpler way to do this?
[/snip]
http://us2.php.net/manual/en/function.mysql-fetch-row.php
In what way would this simplify or ease my pain?
The difficulty, it seems to me, is not in retrieving the rows, but
rather how to pass the row data
You could use list() a la
list($foo, $bar) = mysql_fetch_row();
On Mon, Jun 15, 2009 at 4:19 PM, PJ af.gour...@videotron.ca wrote:
Jay Blanchard wrote:
[snip]
Is there an easier or simpler way to do this?
[/snip]
http://us2.php.net/manual/en/function.mysql-fetch-row.php
In what way
[snip]
In what way would this simplify or ease my pain?
The difficulty, it seems to me, is not in retrieving the rows, but
rather how to pass the row data to the variables. And since the number
of rows is variable, I believe that the only way to assign the variables
is by use of a loop? I think
Jay Blanchard wrote:
[snip]
In what way would this simplify or ease my pain?
The difficulty, it seems to me, is not in retrieving the rows, but
rather how to pass the row data to the variables. And since the number
of rows is variable, I believe that the only way to assign the variables
is
16 matches
Mail list logo