Posted by Robert on 06/01/07 22:17
ZeldorBlat wrote:
> On May 30, 9:47 pm, Robert <lektrikpuke@_yahoo.com> wrote:
>> Hi y'all,
>>
>> The below gives resource error # 4. I've cut a lot of code out in an
>> attempt to just display adv_id twice. The first time works as expected.
>> The second time I get the error.
>>
>> When echoing result, I should be looking for an array to be displayed?
>> If so, how?
>>
>> Thanks.
>>
>> Robert
>>
>> *******************
>>
>> <?php
>> include ("connect.php");
>> ?>
>>
>> <form action="<?php echo "display_details.php" ?>" method="post">
>> <p>Which record would you like to see?</p>
>> <P>Enter Record #<br>
>> <input type=text name="adv_id" size=5>
>> <input type=submit name="submit" value="View Record">
>> </form>
>>
>> <?php
>> if (!empty($_POST))
>> {
>> $adv_id = $_POST['adv_id'];
>> echo "$adv_id";
>> $result=mysql_query("SELECT * FROM advertiser_tbl WHERE adv_id =
>> 'adv_id'") or die
>>
>> (mysql_error());
>> echo "$result";
>> }
>>
>> ?>
>
> mysql_query() returns a /resource/ which you are assigning to
> $result. You need to then use one of the mysql_fetch_* function to
> get the actual rows out. See the manual for more info:
>
> <http://www.php.net/mysql>
>
That helped. Thanks.
[Back to original message]
|