Go Down

Topic: Help: arduino php mysql (electronic toll booth) (Read 6412 times) previous topic - next topic


i m building an electronic toll collection system based on arduino and rfid;i m done with rfid part of the project but i m stucked with the database part of it;i m searching for solutions since weeks but i m nt able to find feasible soltn for this prob;can somebody tell me how do i send unique 10 digit unique id of the rfid to a php code which then queries the mysql db...please help guys..


should help.

You use some kind of network interface card (either ethernet shield or a wifi shield) to connect the arduino to the network that the server is on.

Coding Badly


sorry for the cross post...
i m  using ethernet sheild;thnks for the links but tell me how do i implement it in arduino sketch. i do have rough ideas like sending unique id using HTTP get/post method or like using php serial class for reading serial data..but i need one successful example to know how it works lyk.i simply want to send unique id of rfid tag to php script..after tht i cn manage things


Please can you stop using colloquial abbreviations and start using the shift key?
It makes reading your posts very hard to to those who don't understand your dialect.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.


Exactly which part are you stuck with? At first it sounded like you needed help with databases but then you mention being stuck implementing it with the arduino. What have you tired so far?


Till now i have interfaced the RFID reader with the Arduino;now i want to pass the 10 digit unique ID read by the RFID reader to the PHP script which will then deduct the toll fee from the mysql database.i want to some how pass the unique id from arduino to php script which is stored on the local web server.


Here's a function I use to send temperature data to a web server:
Code: [Select]

void  SendTempToServer()
{ // Use a GET to pass the temp we received to Natasha
char GetRequest[80];
if (client.connect(server, 80))
  sprintf(GetRequest,"GET /cgi-bin/Arduino.cgi?Reading=%s&arduino_id=23&sensor_id=1",Temperature);

Something similar should be what you need.


ok thanks for the reply...i'll try to implement it in my project.


Here's a couple of links that may be useful to you. They deal with reading serial ports with PHP. Once you can get PHP to read the data storing it is easy. PHP and mysql get along nicely. Can we assume your server is just a LAMP box?




thank you very much for the links..unfortunately i m using windows and my server is apache(part of XAMPP package)..still i'll try to use your reference if it works.thanks again..
once i am done with my project i'll post it to community..i am finding many people with the similar problem.


Per your request, the whole thing is attached. The code is for an arduino ethernet with an Xbee. It receives temperature data from another arduino and then sends it to a web server. Obviously, you can drop the xBee stuff and put in your own temp reading. The original version just used wifi and the sensing arduino sent the temps direct but it didn't work in the target location because the wifi signal was too weak.



This is wrong and will cause a 400 error:
Code: [Select]

client.print("GET try.php?code=");

Should be:
Code: [Select]

client.print("GET /try.php?code=");

Also, suggest you use HTTP/1.0 instead of HTTP/1.1. The latter will cause a "keepalive" request and does not close the connection after the request is complete.


i have made changes which u have suggested but still its not working :smiley-sleep:

Go Up