SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Nov 2010
    Location
    ONS
    Posts
    157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is there anything wrong in this? Someone knows why I'm getting the error on line 2nd?

    I have connected with the database but,
    Is there anything wrong in this? Someone knows why I'm getting the error on line 2nd? that is $get_school_name = mysql_fetch_array($get_school_name); everytime.

    I don't know what's the problem...


    Code MySQL:
    $school_id =1;
    $get_school_name = mysql_query("select * from tblSchools where id=$school_id LIMIT 1");
    $get_school_name = mysql_fetch_array($get_school_name);
    return $get_school_name[school_name];

    Error is coming
    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource on line 2

  2. #2
    SitePoint Zealot
    Join Date
    Nov 2010
    Location
    ONS
    Posts
    157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks I solved it.
    Due to my silly mistake, there was no field by the name id in tblSchools.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •