Jump to content

skatermike21988

Members
  • Posts

    100
  • Joined

  • Last visited

    Never

Posts posted by skatermike21988

  1. Hello,

    i am trying to find a way to hide this error
    [code]

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in *****/index.php on line 75
    [/code]
    What i am doing is making a search form, the search works fine but when there are no results it comes up with error and displays this text i have it set to say underneath it:
    [code]
    Your Search Has Returned No Results
    [/code]
    so when nothing returns this is what i am getting
    [code]

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ***/index.php on line 75

    Your Search Has Returned No Results
    [/code]
    All i want to display is the your search has returned no results
  2. This worked for me. It will display a random pic everytime the page is refreshed
    [code]
    $sql = mysql_query("SELECTphoto_id FROM photos ORDER BY rand() LIMIT 1") or die (mysql_error());
    while($info = mysql_fetch_array( $sql ))
    {

    $photo_id=$info['photo_id'];


    $data = mysql_query("SELECT * FROM photos WHERE photo_id='$photo_id'")
    or die(mysql_error());
    while($info = mysql_fetch_array( $data ))
    {
    $photo_source=$info['photo_source'];

    Print "<td><a href='http://www.yoursite.com/displaypic?picid=$photo_id";
    Print "&sid=$sid' target='_self'>";

    Print "<img src='$photo_source' height='75' width='75'>";

    }
    }
    [/code]

    It pulls a random photo id from the database and then performs a query on that id pulling out the image source and displays a link with that id.

    Hope this helps

    **MODIFIED THIS CODE HAVE NOT TESTED** SHOULD WORK FINE THOUGH
  3. Ok, i have tried that code and these are the errors i am recieving, now i am not very familiar with this so i can't exactly go through and debug it myself but the errors are:

    Warning: Wrong parameter count for fread() in /home/friends/public_html/test/set_url.php on line 51

    Warning: fopen(../$url/index.php): failed to open stream: No such file or directory in /home/friends/public_html/test/set_url.php on line 52
    unable to create the requested file
  4. Sorry i took so long for a reply, but here is my code:
    [code]
    $set=$_REQUEST[set];
    if ($set=='url') {
    $url=$_POST[url];
    mkdir("../$url", 0707);
    mkdir("../$url/include", 0707);

    $file = 'http://www.friendshideout.com/test/copy/index.php';
    $newfile = 'temp/index.php';
    copy($file, $newfile);
    $file2 = 'http://www.friendshideout.com/test/copy/include/db.php';
    $newfile2 = 'temp/include/db.php';
    copy($file2, $newfile2);
    $file1 = 'http://www.friendshideout.com/test/copy/include/header.php';
    $newfile1 = 'temp/include/header.php';
    copy($file1, $newfile1);



    $sql="UPDATE `users` SET `url` = 'http://www.friendshideout.com/$url' WHERE username='$username'";
    mysql_query("$sql") or die (mysql_error());
    echo "Congratulations Your New Url Is: http://www.friendshideout.com/$url";
    }
    [/code]

    Hope that helps
  5. Hi guys i am workin on a script that includes gd, and the user can change their font and text displayed on their profile contact, well i am wanting to be able to insert the font names into mysql and have it displayed in a drop down box, this way when i add new fonts i don't have to go and edit my whole script.

    I would also like for when a font is selected it will load the page that parses the gd next to the drop down and display's a preview.

    ALL HELP APPRECIATED
  6. I am working on a project of creating a community script, i am wanting to pull 2-3 random new or old people from my database useing mysql, kinda like myspace's "cool new people" and i am having a hard time getting it to work this is my code:

    [code]
    //Pull and Display cool peorple
    $sql = mysql_query("SELECT display_name FROM users LIMIT 2") or die (mysql_error());
    while($row = mysql_fetch_array($sql)){
        $row_array[] = $row['display_name'];
    }
    $random_row = $row_array[rand(1, count($row_array) - 1)];

    $data = mysql_query("SELECT * FROM users WHERE display_name='$random_row'")
    or die(mysql_error());
    while($info = mysql_fetch_array( $data ))
    {
    Print "<a href='http://www.profiles.friendshideout.com/?friendid=".$info['user_id'] . " ";
    Print "&sid=$sid' target='_self'>";

    Print "<img src='".$info['default_photo'] . "' height='75' width='75'>";
    echo "<br>$random_row</a></td>";

    }
    echo "</tr></table>";
    [/code]

    When useing that code it is only pulling one person out and it is always the same.

    Any help is appreciated.
  7. I have googled for some time now and have yet to have found a answer to my question.

    You know how on forums such as this one and in help desks etc. once you have reached so many replies it displays a link to go onto another page.

    how do you do this.

    i have searched and searched but have not found any results.
  8. Well what i am doing is i have a visitor tracking system and instead of it displaying the long url (like you would get if you searched yahoo, or google etc) for it to display the page title. the way i have it is it logs the user's i.p. how many times they have visited last time they have visited and referrer. and underneath it i have the top ten referrers but displaying a long link like:

    http://search.yahoo.com/search?p=thescreenguy&fr=FP-tab-web-t402&toggle=1&cop=&ei=UTF-8

    have it display the title of the page.
×
×
  • 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.