PHP Classes

File: example_get_column.php

Recommend this page to a friend!
  Classes of Rafal Antczak   RA PHP MySQL CRUD class   example_get_column.php   Download  
File: example_get_column.php
Role: Example script
Content type: text/plain
Description: Example script
Class: RA PHP MySQL CRUD class
Manipulate data in MySQL database tables
Author: By
Last change:
Date: 5 years ago
Size: 657 bytes
 

Contents

Class file image Download
<?php
/*
 * Example - get one specified column from table
 */


// Include Table class

   
require_once 'class.table.php';

   
/*
 * Init new Table object with database parameters specified in db_params.php
 * In this example the name of your table is 'table1'
 */
   
   
$some_table = new Table('table1');

   
// Set the name of column (field) you want to get form table (here we get column with field's name = 'field1')
   
   
$some_table -> column = 'field1';
   
   
   
$my_data = $some_table ->getColumn();
   
   
    if (
$my_data !== FALSE) {
       
       
var_dump($my_data);
       
    }


?>