Help: arduino php mysql (electronic toll booth)

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..

and

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.

@nikpawar, please do not cross-post.

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.

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:

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);
  //Serial.println(GetRequest);
  client.println(GetRequest);
  client.println();
  }
}

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?

http://code.google.com/p/php-serial/

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.

Greenhouse.ino (2.13 KB)

thank you very much for the code.

This is wrong and will cause a 400 error:

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

Should be:

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 :sleeping:

nikpawar:
i have made changes but I am not going to show you the resulting code.

@peterH whats' the use of posting the same erroneous code again and again.i'll post it when it works.Till then suggest some useful changes instead of posting vague statements.

nikpawar:
@peterH whats' the use of posting the same erroneous code again and again.i'll post it when it works.Till then suggest some useful changes instead of posting vague statements.

At this point, if I were peterH, I'd go help someone else! Be polite. The point is that if you post your non-working code, maybe someone can help....

thank you very much everybody for your help..things have worked now..had to change the configuration of webserver..thank you for the support and cooperation..