Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 31

Thread: Php Help Please

  1. #11
    Join Date
    May 2008
    Posts
    605
    Tokens
    0

    Default

    Quote Originally Posted by Johnnikins View Post
    With the one you gave me, is there a way to show a certain banner if there is none with Paid = yes?
    PHP Code:
    if($data[paid] = "No") {
    echo 
    "<img src='urltothenobanner'>";


  2. #12
    Join Date
    Apr 2008
    Posts
    39
    Tokens
    0

    Default

    Okay, that apparantly wants to show up two banners :s

  3. #13
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Excellent1 View Post
    PHP Code:
    if($data[paid] = "No") {
    echo 
    "<img src='urltothenobanner'>";

    PHP Code:
    <?php
    mysql_connect
    ("localhost""""") or die(mysql_error()); // Try putting in your username and password
    mysql_select_db("") or die(mysql_error());  // Try putting in your database

    $query mysql_query("SELECT * from `ads` WHERE Paid = 'Yes'");

    $something mysql_query("SELECT * from `ads`");
    $loldongs mysql_fetch_array($something);

    if(
    $loldongs["Paid"] == "Yes") {
    while(
    $data mysql_fetch_array($query)) { 
    echo 
    "<img src=\""$data["bannerurl"] ."\" /><br /><!-- I imagine that you wanted a breakspace -->";
    echo 
    $data["Site"];
    }
    else {
    echo 
    "<!-- how private.. --><img src=\"URLTOTHABANNER\"><br />Some descriptive text?";
    }
    ?>
    Last edited by Calon; 24-08-2008 at 12:02 AM.

  4. #14
    Join Date
    May 2008
    Posts
    605
    Tokens
    0

    Default

    Quote Originally Posted by Johnnikins View Post
    Okay, that apparantly wants to show up two banners :s
    Oops I forgot about the query that was in use before.
    Last edited by Excellent1; 24-08-2008 at 12:00 AM.

  5. #15
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Calon View Post
    PHP Code:
    <?php
    mysql_connect
    ("localhost""""") or die(mysql_error()); // Try putting in your username and password
    mysql_select_db("") or die(mysql_error());  // Try putting in your database

    $query mysql_query("SELECT * from `ads` WHERE Paid = 'Yes'");

    $something mysql_query("SELECT * from `ads`");
    $loldongs mysql_fetch_array($something);

    if(
    $loldongs["Paid"] == "Yes") {
    while(
    $data mysql_fetch_array($query)) { 
    echo 
    "<img src=\""$data["bannerurl"] ."\" /><br /><!-- I imagine that you wanted a breakspace -->";
    echo 
    $data["Site"];
    }
    else {
    echo 
    "<img src=\"URLTOTHABANNER\"><br />Some descriptive text?";
    }
    ?>
    I think mine might work, I'm really tired and a tiny bit drunk so, sorry if it doesn't work.

  6. #16
    Join Date
    Apr 2008
    Posts
    39
    Tokens
    0

    Default

    thank you both, i just had to change a few of the names and it worked

    :]

  7. #17
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    Quote Originally Posted by Calon View Post
    I think mine might work, I'm really tired and a tiny bit drunk so, sorry if it doesn't work.
    Wat the hell is that man, that confuses the hell into me...

    What did this guy actually want in full context :|
    Hi, names James. I am a web developer.

  8. #18
    Join Date
    Apr 2008
    Posts
    39
    Tokens
    0

    Default

    I wanted a script which would display a certain banner if Paid = Yes, if not it would display an alternative banner, and even though he may have been drunk it worked perfectly

  9. #19
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Johnnikins View Post
    I wanted a script which would display a certain banner if Paid = Yes, if not it would display an alternative banner, and even though he may have been drunk it worked perfectly
    Dude, we don't want people's life stories!

  10. #20
    Join Date
    Apr 2008
    Location
    England.
    Posts
    1,324
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Calon View Post
    Dude, we don't want people's life stories!
    Stop sucking up to protege.

Page 2 of 4 FirstFirst 1234 LastLast

Posting Permissions

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