Jump to content

ameer71

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ameer71's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. please tell me the reason that why mysql_fetch_array does not work inside a function for example the following works well in its current form $sql="SELECT * FROM $tbl_13"; $query=mysql_query($sql); while($rs=mysql_fetch_array($query)){ $p0 = $rs["pfid"]; $pm = $rs["pm"]; } but when i put it inside a function it gives me an error at function defone() { $sql="SELECT * FROM $tbl_13"; $query=mysql_query($sql); while($rs=mysql_fetch_array($query)){ $p0 = $rs["pfid"]; $pm = $rs["pm"]; } return $pm; } the error message is... Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in... Please identify the problem.. i'm an experience programmer in ruby and perl but new in php
  2. i have the following code... it works well in it's current position... $profile_sql="SELECT * FROM $tbl_12"; $profile_query = mysql_query($profile_sql); while($rs_profile = mysql_fetch_array($profile_query)){ $profile_ph = $rs_profile["ph"]; $profile_pm = $rs_profile["pm"]; } but if i put it in a function it gives me an error... like this... function get_profile() { $profile_sql="SELECT * FROM $tbl_12"; $profile_query = mysql_query($profile_sql); while($rs_profile = mysql_fetch_array($profile_query)){ $profile_ph = $rs_profile["ph"]; $profile_pm = $rs_profile["pm"]; echo $profile_pm; } } Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.