Jump to content

stored ms access query to be executed in php


Sairam

I have a query named query1 in ms access. How do I access and execute this query in php?  

  1. 1. I have a query named query1 in ms access. How do I access and execute this query in php?

    • I dont know what this is
      0
    • I dont know what this is
      0


Recommended Posts

I have created a query in MS Access database and named it as query1. I want to be able to execute this query through php code. I can understand the following code.

 

$conn=odbc_connect("mydb","root","pwd");

if($conn)

{

    $sql="select * from mytable";

    $row=odbc_exec($conn, $sql);

    $i = 0;

   

    while(odbc_fetch_row($row))

    {

        $i++;

        $name = odbc_result($row,1);

        $make = odbc_result($row,2);

        $model = odbc_result($row,3);       

    }

}

 

My question is how to give query1 to $sql or replace $sql in "$row=odbc_exec($conn, $sql);" with "$row=odbc_exec($conn, query1);"

 

I am new to programming in php. Please help me fix this problem. Your help is much appreciated. Thanks in advance.

 

Best Regards,

Sairam

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.