You can embedded the result of mysql into the below script.

<?php
// Connecting, selecting database
$link = mysql_connect('192.168.1.8', 'dip', 'dip')
    or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';
mysql_select_db('dip') or die('Could not select database');

// Performing SQL query
//$query = 'SELECT * FROM user_info limit 15';

$query = 'SELECT * FROM user_info ';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());

// Printing results in HTML
echo "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
    echo "\t<tr>\n";
    foreach ($line as $col_value) {
        echo "\t\t\t<td>$col_value</td>\n";
    }
    echo "\t</tr>\n";
}
echo "</table>\n";

// Free resultset
mysql_free_result($result);

// Closing connection
mysql_close($link);
?>

On Tue, Jan 20, 2009 at 11:31 PM, <cr.vege...@gmail.com> wrote:

>  Hi Krishna,
>
> Would you be so kind to give some pointers / refs ?
> Or may be a snippet ...
>
> TIA, Cor
>
> ----- Original Message -----
> *From:* Krishna Chandra Prajapati <prajapat...@gmail.com>
> *To:* cr.vege...@gmail.com
> *Cc:* J Trahair <j.trah...@foreversoftware.co.uk> ; MySQL 
> General<mysql@lists.mysql.com>
> *Sent:* Tuesday, January 20, 2009 3:48 PM
> *Subject:* Re: Applying an XML request to a database
>
> Yes
>
> On Tue, Jan 20, 2009 at 7:40 PM, <cr.vege...@gmail.com> wrote:
>
>> Hi Krishna,
>>
>> I just tried the -X and -H options as you described. Works fine.
>> Is it also possible to get -X or -H data from MySQL into PHP ?
>>
>> TIA, Cor
>>
>> ----- Original Message ----- From: "Krishna Chandra Prajapati" <
>> prajapat...@gmail.com>
>> To: "J Trahair" <j.trah...@foreversoftware.co.uk>
>> Cc: "MySQL General" <mysql@lists.mysql.com>
>> Sent: Tuesday, January 20, 2009 10:28 AM
>> Subject: Re: Applying an XML request to a database
>>
>>
>>
>> Hi,
>>>
>>> You can use -X for xml and -H from html. See the example below.
>>>
>>> debian76:~# mysql -h 192.168.1.10 -u teen -D teen -pteen -X
>>> Reading table information for completion of table and column names
>>> You can turn off this feature to get a quicker startup with -A
>>>
>>> Welcome to the MySQL monitor.  Commands end with ; or \g.
>>> Your MySQL connection id is 27178
>>> Server version: 5.0.32-Debian_7etch8-log Debian etch distribution
>>>
>>> Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
>>>
>>> mysql>
>>>
>>> mysql> select * from user_time_stamp limit 2;
>>> <?xml version="1.0"?>
>>>
>>> <resultset statement="select * from user_time_stamp limit 2;">
>>>  <row>
>>>       <field name="user_id">1072005</field>
>>>       <field name="task">1.1.1</field>
>>>       <field name="time_in">1126267377</field>
>>>       <field name="time_total">11</field>
>>>  </row>
>>>
>>>  <row>
>>>       <field name="user_id">1072005</field>
>>>       <field name="task">1.1.2</field>
>>>       <field name="time_in">1126267388</field>
>>>       <field name="time_total">-999</field>
>>>  </row>
>>> </resultset>
>>> 2 rows in set (0.03 sec)
>>>
>>>
>>>
>>> On Tue, Jan 20, 2009 at 2:29 PM, J Trahair
>>> <j.trah...@foreversoftware.co.uk>wrote:
>>>
>>> Hi Everyone
>>>>
>>>> I am interested in how to get an XML request to query a database. I'm
>>>> working on generating the XML requests OK, I just need to know how XML
>>>> meets
>>>> database. Are there any generalised pointers to begin with?
>>>>
>>>> Thanks in advance
>>>>
>>>> Jonathan Trahair
>>>>
>>>
>>>
>>>
>>>
>>> --
>>> Krishna Chandra Prajapati
>>> MySQL DBA,
>>> Ed Ventures e-Learning Pvt.Ltd.
>>> 1-8-303/48/15, Sindhi Colony
>>> P.G.Road, Secunderabad.
>>> Pin Code: 500003
>>> Office Number: 040-66489771
>>> Mob: 9912924044
>>> URL: ed-ventures-online.com
>>> Email-id: prajapat...@gmail.com
>>>
>>>
>>
>>
>
>
> --
> Krishna Chandra Prajapati
> MySQL DBA,
> Ed Ventures e-Learning Pvt.Ltd.
> 1-8-303/48/15, Sindhi Colony
> P.G.Road, Secunderabad.
> Pin Code: 500003
> Office Number: 040-66489771
> Mob: 9912924044
> URL: ed-ventures-online.com
> Email-id: prajapat...@gmail.com
>
>


-- 
Krishna Chandra Prajapati
MySQL DBA,
Ed Ventures e-Learning Pvt.Ltd.
1-8-303/48/15, Sindhi Colony
P.G.Road, Secunderabad.
Pin Code: 500003
Office Number: 040-66489771
Mob: 9912924044
URL: ed-ventures-online.com
Email-id: prajapat...@gmail.com

Reply via email to