On Sunday 24 February 2002 04:03, jtjohnston wrote:
I'm splitting mysql entries to build an array of author names called
$authors.
As someone already suggested, you could use:
array_push($authors, explode(;, $mydata-AS));
http://ccl.flsh.usherb.ca/db/authors_under_study.php
It works,
On Saturday 23 February 2002 14:43, jtjohnston wrote:
OK. I use:
while ($mydata = mysql_fetch_object($news))
{
$authors = explode(;, $mydata-AS);
}
Then why Invalid argument supplied for foreach()
Have you checked that $authors is indeed an array? Try print_r($authors), if
you see
Let's work on some debugging. By using mysql_error()
you'd eventually find out that AS is a reserved word
in mysql, see:
http://www.mysql.com/doc/R/e/Reserved_words.html
That said, here's some example code to play with,
untested but should work.
if (!$conn = mysql_connect($host, $user,
I'm splitting mysql entries to build an array of author names called $authors.
As someone already suggested, you could use:
array_push($authors, explode(;, $mydata-AS));
http://ccl.flsh.usherb.ca/db/authors_under_study.php
It works, but still gets First argument to array_push() needs to be
OK. I use:
while ($mydata = mysql_fetch_object($news))
{
$authors = explode(;, $mydata-AS);
}
Then why Invalid argument supplied for foreach()
Am I indeed building an array as I go through my database?
foreach($authors as $author)
{
#echo sort($author).br\n;
echo $authorbr\n;
}
5 matches
Mail list logo