Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
how to create a function that will eliminate the view of values equal to zero?
Old 11-04-2010, 06:03 AM how to create a function that will eliminate the view of values equal to zero?
Junior Talker

Posts: 1
Trades: 0
how to create a function that will eliminate the view of values equal to zero. can I do it only with "IF". the php is conected with the database
technoboy01 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-04-2010, 07:34 AM Re: how to create a function that will eliminate the view of values equal to zero?
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
What do you mean by 'eliminate the view of values'? You can use if statements to compare something to zero:
PHP Code:
if($foo == 0)
{
     
//do something

I'm really not sure what you're asking.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 11-06-2010, 07:14 PM Re: how to create a function that will eliminate the view of values equal to zero?
Junior Talker

Posts: 4
Name: Tarquin
Trades: 0
Let's say you want to show results that do not have 0 downloads from a file database?
PHP Code:
    $ObtainInfo mysql_query("SELECT * FROM `MyFiles` WHERE `downloads` != '0' "); 
turn this into an array and output as needed.

Otherwise you can use if statements and check each result individually before outputting;

PHP Code:
    $ObtainInfo mysql_query("SELECT * FROM `MyFiles`");
    
$Info mysql_fetch_array($ObtainInfo);

    if(
$Info['downloads'] != '0'){
        echo 
$Info['title'];
    } 
Of course you can adapt to be more than, less than etc using these techniques based on if you are more familiar with PHP or MySQL syntax's/
Tarquin is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to how to create a function that will eliminate the view of values equal to zero?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20235 seconds with 12 queries