|
Posted by TechieGrl on 08/28/07 21:25
On Aug 28, 3:57 pm, "burgermeiste...@gmail.com"
<burgermeiste...@gmail.com> wrote:
> > Here is the error:
> > Fatal error: Cannot pass parameter 2 by reference...
>
> > Any thoughts would be so VERY much appreciated!!!
>
> If I'm reading your code right, it should just be a simple matter of
> correcting your array references.
> I think the following lines of code need to change like so...
>
> ...
> $field1 = $i[0];
> $field2 = $i[1];
> ...
>
> $i is already assigned to each subsequent value of $rss->items_array,
> so in the code that you posted, you're iterating through the array and
> then using one of the array's 2nd dimension arrays as an array
> position. I haven't used the method you're employing to make sql
> statements, so there could be further problems, but this one seems
> fairly glaring to me.
Unfortunately, I made the changes as suggested and still get the same
error - Fatal error: Cannot pass parameter 2 by reference...
I replaced this:
$stmt_insert->bind_param($sql_insert, 'is', $field1, $field2);
$field1 = $rss->items_array[$i][0];
$field2 = $rss->items_array[$i][1];
echo "sql " . $sql_insert . "\n";
$stmt_insert->execute();
With this:
$stmt_insert->bind_param($sql_insert, 'is', $field1, $field2);
$field1 = $i[0];
$field2 = $i[1];
echo "sql " . $sql_insert . "\n";
$stmt_insert->execute();
Thanks!
Navigation:
[Reply to this message]
|