after years of doing classic ASP i am giving PHP a go so bear with me.
i am trying to test a simple build a table from data in my SQL database and i keep getting errors, can someone check my code
<?php
// connect to the database
$connect = odbc_connect("ODBCNAME", "USERNAME", "PASSWORD");
// select everything from the table
$query = "SELECT * FROM test_table";
$result = odbc_connect($query);
while( ($row = mysql_fetch_array($result)))
{
echo " <td><input type='checkbox' /></td>";
echo " <td>".$row['ref']."</td>";
echo " <td><a href='client.html' class='tablelink'>".$row['name']."</a></td>";
echo " <td>".$row['type']."</td>";
echo " <td class='center'>".$row['tel']."</td>";
echo " </tr>";
// disconnect from the database
mysql_close();
?>
my last error is PHP Parse error: syntax error, unexpected $end
can someone please look at my code and see why i get the error and also let me know if its constructed badly etc. I want to use ODBC connections like i do in ASP and I also want to start including the connection string rather than using it on each page
thanks for any help
i am trying to test a simple build a table from data in my SQL database and i keep getting errors, can someone check my code
<?php
// connect to the database
$connect = odbc_connect("ODBCNAME", "USERNAME", "PASSWORD");
// select everything from the table
$query = "SELECT * FROM test_table";
$result = odbc_connect($query);
while( ($row = mysql_fetch_array($result)))
{
echo " <td><input type='checkbox' /></td>";
echo " <td>".$row['ref']."</td>";
echo " <td><a href='client.html' class='tablelink'>".$row['name']."</a></td>";
echo " <td>".$row['type']."</td>";
echo " <td class='center'>".$row['tel']."</td>";
echo " </tr>";
// disconnect from the database
mysql_close();
?>
my last error is PHP Parse error: syntax error, unexpected $end
can someone please look at my code and see why i get the error and also let me know if its constructed badly etc. I want to use ODBC connections like i do in ASP and I also want to start including the connection string rather than using it on each page
thanks for any help