rabbitsfeat Posted February 6, 2008 Share Posted February 6, 2008 Can anyone help? I'm working through the MySQL tutorials at w3schools and the final one wants me to connect to something called ODBC. Take a look here: http://www.w3schools.com/php/php_db_odbc.asp Later I have to select which driver to use... it just says to select the Microsoft Acess Driver... well there are 2 of these and I don't know which one to pick. Please can someone help? I don't even know what this ODBC thing is for or if it's even worth me doing this part of the tutorial... perhaps someone can explain—maybe it's essential??? Quote Link to comment https://forums.phpfreaks.com/topic/89801-solved-odbc/ Share on other sites More sharing options...
budimir Posted February 6, 2008 Share Posted February 6, 2008 Hey ther, Actually using ODBC driver is very easy. First of all, you need to select odbc driver and create an odbc connection. You go to Control Panel, click on Administration tools, then click on Data Sources (ODBC). When the window opens up, click on a tab called System DSN. Click on ADD, select Driver to MS Access. When the second window opens up put a name in "Data source name" (this is the name which you will use for calling the connection for the ODBC driver), click on SELECT and choose where your Access database resides. After that click on OK and you are set to go. Now, create a PHP script and put in a connection line like this: $cx=odbc_pconnect("Data_source_name","","",""); And after this, you handle it like normal PHP + MySQL code. Of course the code is a little bit diferent, but there is a lot information about this on the web. Here is a sample of query: $cur=odbc_exec($cx,"select Oznaka,Naziv,JedinicaMjere,Pak,TarifnaSkupina,Dobavljac,Klasa,Vrsta,MinKol,MaxKol,OptKol,Cijena1,Cijena2, AVal,ACijena3,ACijena4,AVal2,ASkSmj,Altsifra,ARab,AdrPor,Barcode from TblArtikli"); I hope you got an idea. How to work with it. This is very basic. Quote Link to comment https://forums.phpfreaks.com/topic/89801-solved-odbc/#findComment-460191 Share on other sites More sharing options...
rabbitsfeat Posted February 6, 2008 Author Share Posted February 6, 2008 I'm not really sure what it is no! I just wanna know which driver to use: Microsoft Access Driver (*.mdb) or Microsoft Acess Driver (*.mdb, *.accdb) ? Quote Link to comment https://forums.phpfreaks.com/topic/89801-solved-odbc/#findComment-460217 Share on other sites More sharing options...
budimir Posted February 6, 2008 Share Posted February 6, 2008 This one! Microsoft Access Driver (*.mdb) Quote Link to comment https://forums.phpfreaks.com/topic/89801-solved-odbc/#findComment-460225 Share on other sites More sharing options...
rabbitsfeat Posted February 6, 2008 Author Share Posted February 6, 2008 Thank you! May the force be with you... Quote Link to comment https://forums.phpfreaks.com/topic/89801-solved-odbc/#findComment-460230 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.