Link to home
Start Free TrialLog in
Avatar of James Williams
James WilliamsFlag for United States of America

asked on

SQLite Form Example PHP Windows Wamp

Hello, I am staring out w/ sql/Sqlite but am familiar with PHP.'

My question is how would I Add, and retrieve Queries via form using PHP and SQLilte.

Where I get confused is how do I search for an individual entry in the DB?
DO I need to create a Table for each entry?  

I need to input then retrieve  this example data  below via web form?
Can anyone give me a working example of how to do this?

123456 some data
456789 good stuff
654321 great news

I would like to be able to do a  search for "123456".
And have the results display "123456 some data".

Some reason I am not able do this,
I have searched Google and read a few Tutorials
but have not found the answer,



Regards,
<Selvol
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

I tried Example #1 on this page and it worked: http://us2.php.net/manual/en/function.sqlite-open.php  You have to enable two extensions, php_sqlite and php_pdo_sqlite.  And I did have to make the directory Write-able where the database was created.  If you have a php_sqlite_external extension, do Not enable it because the DLL isn't there.
Avatar of James Williams

ASKER

Dave, I have the ext. enabled.

The confusion I am having lies in
"Where do I put information so I can retrieve it via web form.
   sqlite_query($db, 'CREATE TABLE foo (bar varchar(10))');
    sqlite_query($db, "INSERT INTO foo VALUES ('fnord')");
    $result = sqlite_query($db, 'select bar from foo');

Open in new window


What do I do if I want to enter

123456 some data

Where a search for
"123456"
would return
"123456 some data."

Does any one have a working example to do this?
SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No, no experience at all with any SQL...
I have read some but will read the above..

<Selvol
This search https://www.google.com/search?q=SQLite+PHP+searching will show you examples of using PHP and SQLite to do searches of an SQLite database.
Since you have WAMP, it would be easier to use MySQL since phpMyAdmin comes with it.  You can use it to become familiar with SQL commands and databases.  There is going to be a bit of learning before you can easily do the things you want to do.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hello, Thank you both.

Yes, wamp and mysql I have used the built in MySql.

What I am creating in the end is a EXE using EXE output for PHP.

I am familiar with php and the EXE output but got stuck on the
SQLite.

I will do some testing and get back to this question.

Thank you both again.

<Selvol
What are you using to create an EXE?
Dave, I am using "EXEoutPut For PHP".

It allows you to create an EXE fairly easily.   Where you can do pretty much any thing you can do with PHP but in an EXE.....

Really a great program....


I have used Bamcompile and like it for small stuff.
Unlike Bamcompile this program has an actual GIU.


<Selvol
That's cool, I think I'll try them out.
Thank you both.

<Selvol

Dave,
Yes, really cool.....
I found them about a year ago....

Once you get the program concepts down  you can put together anything you can do in php.

Since I knew PHP the best ouf of my chosen codes. I was glad to actually be able to create
fully functional EXE's.
Slick812,  Thank you Very Much for That "right on The Money" Tutorial.

I appreciate your help.........  That was Exactly what I Needed.....

<Selvol