Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Member mikaelsnavy's Avatar
    Join Date
    Jun 2005
    Location
    Oregon
    Posts
    48
    Member #
    10358
    Hi,
    I was wondering if it would be possible to make a php if statement that would do something if the one certain place of lets say, data pulled off of a database equaled the letter "i". So it would be like
    Code:
    if ( $response == "certain charter in response, ex. charcter number 113" ) {
    echo "Hello World!";
    }
    Thanks a lot,
    Mikael

  2.  

  3. #2
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    Yes, I use the same for statistics of a table like so..

    PHP Code:
    $result mysql_query('SELECT COUNT(*) FROM users WHERE activated="yes"') or die('Unable to get number of registered members.');
    echo 
    'Registered Members: 'mysql_result($result0), '.';
    $number_of_mem mysql_result($result0);

    // $number_of_mem contains an integer value, which represents number of users
    // heres some code that outputs different content depending on that value

    $result mysql_query('SELECT user_name FROM users ORDER BY img_count DESC LIMIT 1') or die("Unable to get user with most images uploaded");

    if(
    $number_of_mem >= 1) {
    echo 
    'Member With Most Files Uploaded: 'mysql_result($result0), '.';
    } else { echo 
    "Member With Most Files Uploaded: no members";} 
    In this example I am using numbers, hence the no quotes around the value.

    Hope this helps.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 07:05 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com