SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot JordanTLClive's Avatar
    Join Date
    Feb 2001
    Location
    Las Vegas, NV
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Im having a bit of trouble with this. If you go to http://www.hotmusicstars.com/php/new...w/artist/Creed it should pull up a page saying "No Bio Submitted" however it gives a blank error. You can check the code at http://www.hotmusicstars.com/php/newbios.txt (and yes, newbios.php has the real password in it, i just x'ed it out in the text file)

    Anyone have a clue? Cuz I dont!
    -Jordan

  2. #2
    SitePoint Evangelist
    Join Date
    May 2000
    Location
    Canada
    Posts
    533
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    your code says:

    $querys=mysql_query("SELECT * FROM bios WHERE artistid='$artist'");

    artistid='$artist'

    my question is , it says artistid , is that supposed be an ID number ? .. because your URL looks like its passing it a string, not an int ... I mean, the url has Creed .
    cogito, ergo sum

  3. #3
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, from the code in http://www.hotmusicstars.com/php/newbios.txt I'm damned if I can see where you test to see if the result set is indead empty.

    All I see is this (line 159)

    <? echo $bio ?>

    which will print out the contents of the variable $bio regardless of whether it is NULL or actually contains a string.

    You could test to see whether the resultset is empty by doing this (around line 68):

    PHP Code:
    if ( mysql_num_rows($querys) > ) {
       
    $results mysql_fetch_array($querys);
       
    $bio $results["bio"];
    } else {
       
    $bio "No Bio submitted";

    Last edited by freakysid; Feb 23, 2001 at 06:47.

  4. #4
    SitePoint Zealot JordanTLClive's Avatar
    Join Date
    Feb 2001
    Location
    Las Vegas, NV
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No in MySQL all the artists have "No Bio Submitted" in the bio column until it has been updated by the administration panel.
    -Jordan

  5. #5
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OIC - my bad assumption.

    Looking at the code and looking at the page generated. you are not getting any error messages - so the query is executing OK. My guess is that you have an empty result set.

    I notice that you are using one of the fancy search engine friendly URL methods for passing your parameters in the URL. And I'm not familiar with what you are doing.

    Hmm, is $artist being set correctly? Perhaps write a line of code for debugging purposes to echo $artist.

    Don't you just love debugging?

  6. #6
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    actually - I take that back because you do print out the artist name one the page - duh! :P

    Still thinking...

    Perhaps after the mysql_query() print out the value of mysql_num_rows($queries) to see whether the result set is empty.

    If it isn't empty - then check that the column in the database is in fact called "bio"
    Last edited by freakysid; Feb 23, 2001 at 13:01.


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
  •