Custom Bots
We create custom IM bots.
Black Green Blue Red Gold
RSS
  • Home PageHome
  • Customize Your Bot / Hire a Freelancer
  • How to Create a Custom Bot / Bot Making Software
  • IMDB to WordPress
  • Youtube Comment Poster Bot

How do I create a function to retrieve values ??from the database

Codes & Scripts Add comments

I want to create a function to call a key and value on specific table.

Basically my statement like this

$query = 'SELECT SQL_CALC_FOUND_ROWS
         '.$key.'
          FROM users
          WHERE
          status="'.$value.'"';

Now I want implement in function

function counter('what to put here') {
    $query = 'SELECT SQL_CALC_FOUND_ROWS
             '.$key.'
              FROM users
              WHERE
              status="'.$value.'"';
if (!($result = @mysql_query($query))) {
die(mysql_error());
}
$rows = mysql_fetch_assoc(mysql_query('SELECT FOUND_ROWS() AS rows'));
return $rows['rows']; // what to return here
}

And to call the function

<?php echo counter('KEY','VALUE'); ?>

Let me know how to achieve my goal..

Related Posts:

  • Sum of the values by date
  • Function cr? tion of an object in JavaScript
  • MySQL Query: R? Newspaper Group Results hour minute | | | days | and f? Cases L? Press with empty table Assistance
  • Mysql insert multiple rows at once
  • Add array_push not sawing, at the end of the array, there is replacement of the entire array

June 19th, 2011  
Tags: create, Database, From, Function, Retrieve, values

Leave a Reply

CAPTCHA Image CAPTCHA Audio
Refresh Image

Custom Bots Sponsors

  • Categories

    • Codes & Scripts
    • Custom Requests
    • Download
    • Entertainment
    • Free Downloads
    • games-entertainment
    • How To/Articles
    • Marketing
    • Review
    • Seo Services
    • Software
    • Video Tutorial
    • Youtube
  • Recent Posts

    • BASE DE DATOS EN VISUAL BASIC CON ADO – CECYTEM TECAMAC 3/4
    • BASE DE DATOS EN VISUAL BASIC CON ADO – CECYTEM TECAMAC 3/4
    • Internet sales of drugs locally
    • Andriod App st rzt from? Installing
    • Booking data. aspx page to third-party PHP Site
    • Everything You Need To Know About Windows
    • Netmobiweb – Marketing in cellular and mobile Ren – In Internet Marketing
    • Unrecoverable git push?
    • Spare Room (mughal959)
    • php tutorial – 2.07 comments
  • Blogroll

    • Rock Kitty
Categories
  • Codes & Scripts
  • Custom Requests
  • Download
  • Entertainment
  • Free Downloads
  • games-entertainment
  • How To/Articles
  • Marketing
  • Review
  • Seo Services
  • Software
  • Video Tutorial
  • Youtube
About Me

Write about yourseft, This is just a sample: Welcome to iSoftwareReviews where you can find reviews, ratings, comparisons about variety of computer software programs.

Hi, my name ChanDara and I am a software programmer, web design and development, graphics designer, software trainer, software consultant. And I have worked in IT for more than... Read more

Free Wordpress Themes | Copyright © 2012 Custom Bots All Rights Reserved XHTML CSS THEME by I SOFTWARE REVIEWS