| View previous topic :: View next topic |
| Author |
Message |
denis Guest
|
Posted: Thu Mar 18, 2004 12:14 am Post subject: PHP & access |
|
|
| how do i use php and access database for a website,where can i seekl info bout it.sample code etc |
|
| Back to top |
|
 |
lostboy

Joined: 02 May 2004 Posts: 6033 Location: toronto, canada
|
Posted: Mon May 03, 2004 9:28 pm Post subject: |
|
|
| have you worked this out yet? The basics are ODBC and setting a dsn for the access db... |
|
| Back to top |
|
 |
ddwebguru
Joined: 16 Jul 2008 Posts: 195 Location: India
|
Posted: Mon Sep 29, 2008 8:45 am Post subject: |
|
|
| You have to define the path for your database from administrative tool of your computer,then you will be able to link. |
|
| Back to top |
|
 |
nilapsa
Joined: 16 Feb 2010 Posts: 1
|
Posted: Tue Feb 16, 2010 6:11 am Post subject: Very useful thing to know |
|
|
| The php is most often used to create dynamic websites ans projects include forums or communities organizers, project management tools, calendars, shopping carts, mailing lists, and all sorts of useful applications. And the php is server side scripting language such as ASP and JSP. Thank you for sharing this useful information with us. |
|
| Back to top |
|
 |
lahmanwokard
Joined: 15 Feb 2010 Posts: 4 Location: london
|
Posted: Wed Feb 17, 2010 8:25 am Post subject: |
|
|
Hello denis
An ODBC simple Example to access Database to your website
The following example shows how to first create a database connection, then a result-set, and then display the data in an HTML table.
Connecting to an ODBC
The odbc_exec() function is used to execute an SQL statement.
Example
$conn=odbc_connect('northwind','','');
$sql="SELECT * FROM customers";
$rs=odbc_exec($conn,$sql);
<html>
<body><?php
$conn=odbc_connect('northwind','','');
if (!$conn)
{exit("Connection Failed: " . $conn);}
$sql="SELECT * FROM customers";
$rs=odbc_exec($conn,$sql);
if (!$rs)
{exit("Error in SQL");}
echo "<table><tr>";
echo "<th>Companyname</th>";
echo "<th>Contactname</th></tr>";
while (odbc_fetch_row($rs))
{
$compname=odbc_result($rs,"CompanyName");
$conname=odbc_result($rs,"ContactName");
echo "<tr><td>$compname</td>";
echo "<td>$conname</td></tr>";
}
odbc_close($conn);
echo "</table>";
?></body>
</html>
Hope it will useful for you. |
|
| Back to top |
|
 |
StephenHarry
Joined: 17 May 2010 Posts: 2
|
Posted: Mon May 17, 2010 1:12 pm Post subject: |
|
|
| Thanks for sharing the code by which we can learn the database connectivity. |
|
| Back to top |
|
 |
vipin kumar
Joined: 05 Apr 2010 Posts: 26
|
Posted: Tue May 25, 2010 8:18 am Post subject: |
|
|
| can we use php easily? |
|
| Back to top |
|
 |
lostboy

Joined: 02 May 2004 Posts: 6033 Location: toronto, canada
|
Posted: Fri May 28, 2010 2:05 pm Post subject: |
|
|
| Yes |
|
| Back to top |
|
 |
Paul Daniel
Joined: 12 May 2010 Posts: 63
|
|
| Back to top |
|
 |
|