# Retreiving data from a table

**URL:** https://forum.kirupa.com/t/retreiving-data-from-a-table/230509
**Category:** programming
**Created:** [June 26, 2007, 8:24pm UTC](https://forum.kirupa.com/t/retreiving-data-from-a-table/230509 "2007-06-26T20:24:09Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Syous](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@Syous](https://forum.kirupa.com/u/Syous)
#### Post date: [June 26, 2007, 8:24pm UTC](https://forum.kirupa.com/t/retreiving-data-from-a-table/230509/1 "2007-06-26T20:24:09Z")

</div>

Alright, database name is “mynewwine\_admin”, tables name is “schedule”.

In the table I have several fields, (ID, time, date, event, and details). I’ve put some info into each field for test purposes. My question is how do I get my script working so I can retrieve the data? Currently I get a T-STRING error in line 12, but I don’t see an issue.

Eventually I plan to have a form built so the client can submit data to the fields, then with PHP/flash it pulls the submitted data to the front page.

```php
<html><head><title>Get Data</title></head>
<body>

<?php

$conn = @mysql_connect ( "localhost", "username", "password" )
                         or die ( "Error : Connection ) ;

$rs = @mysql_select_db( "mynewwine_admin", $conn )
                         or die ( "Error - Database" ) ;
						 
$sql="select id, event from schedule";

$rs = mysql_query( $sql,$conn );

while( $row = mysql_fetch_array( $rs ) )
{
   echo("Event: " . $row["event"] ."<br>);
   }

?>

</body></html>

```
