CGI script to sql db

I am not sure if you can help - but I am desparate so I will ask anyway.

I have a solaris server which I am running apache and mysql db on.
I have a basic web page (internal to my lan only)
I know some shell scripting (ksh etc) and I can create a very basic cgi script using shell scripting.

I want to be to interface with my 'mysql' db using a script and pull back the details to the web page...
I also want for a user to be able to enter a number (ie a log number) on a web form and this gets submitted using the cgi script and executes some sql to the db based on the log number..

Any ideas to help me get started here? I really have no clue what the best way to do this is using cgi scripts etc and my html is also very basic..

Obviously I didnt look hard enough - Found exactly what I was looking for:

http://www.scit.wlv.ac.uk/~jphb/sst/sh/ex3d.html

Thanks all the same :smiley: