Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

PHP and Open Office Database


  • Please log in to reply
34 replies to this topic

#13 haraldur

haraldur

    CC Resident

  • Just Joined
  • PipPipPipPip
  • 50 posts

Posted 22 November 2009 - 01:51 AM

And also im useing Ubuntu so can i download SQLite for Linux somewhere?
  • 0

#14 Orjan

Orjan

    CC Mentor

  • Moderator
  • 2918 posts
  • Location:Karlstad, Sweden
  • Programming Language:C, Java, C++, C#, PHP, JavaScript, Pascal
  • Learning:Java, C#

Posted 22 November 2009 - 02:58 AM

You use sqlite_open instead of mysql_connect, then, you have a set of sqlite_ functions instead of mysql_ functions, but they almost work the same
  • 0

I'm a System developer at XLENT Consultant Group mainly working with SugarCRM.
Please DO NOT send mail or PM to me with programming questions, post them in the appropriate forum instead, where I and others can answer you.


#15 haraldur

haraldur

    CC Resident

  • Just Joined
  • PipPipPipPip
  • 50 posts

Posted 22 November 2009 - 03:06 AM

But i have a laptop that im useing for those test, do i need to have both the SQLite and PHP apache hosting on that computer? Or can i host the .php files on the internet but still have the SQLite on my computer and still have it working?
  • 0

#16 Orjan

Orjan

    CC Mentor

  • Moderator
  • 2918 posts
  • Location:Karlstad, Sweden
  • Programming Language:C, Java, C++, C#, PHP, JavaScript, Pascal
  • Learning:Java, C#

Posted 22 November 2009 - 03:27 AM

well, you only need the datafile to make it work, SQLite is included in PHP.
  • 0

I'm a System developer at XLENT Consultant Group mainly working with SugarCRM.
Please DO NOT send mail or PM to me with programming questions, post them in the appropriate forum instead, where I and others can answer you.


#17 haraldur

haraldur

    CC Resident

  • Just Joined
  • PipPipPipPip
  • 50 posts

Posted 22 November 2009 - 03:41 AM

So to do it in the start of the script i write i write

<?
include 'database.db';

and also do i upload it to the site, like i use a subdomain, do i upload that file up to that subdomain? or do i just keep it on my computer?
  • 0

#18 chili5

chili5

    CC Mentor

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3038 posts
  • Programming Language:Java, C#, PHP, JavaScript, Ruby, Transact-SQL
  • Learning:C, Java, C++, C#, PHP, JavaScript, Ruby, Transact-SQL, Assembly, Scheme, Haskell, Others

Posted 22 November 2009 - 05:12 AM

upload it.
  • 0

#19 haraldur

haraldur

    CC Resident

  • Just Joined
  • PipPipPipPip
  • 50 posts

Posted 22 November 2009 - 05:19 AM

But i upload the database, but do i need to upload it again with new info whenever i want to update, like if someone registers does the username and password does it automaticly go onto the database i uploaded?
  • 0

#20 Orjan

Orjan

    CC Mentor

  • Moderator
  • 2918 posts
  • Location:Karlstad, Sweden
  • Programming Language:C, Java, C++, C#, PHP, JavaScript, Pascal
  • Learning:Java, C#

Posted 22 November 2009 - 05:43 AM

as with any other database, your php script need to add the information to the database
  • 0

I'm a System developer at XLENT Consultant Group mainly working with SugarCRM.
Please DO NOT send mail or PM to me with programming questions, post them in the appropriate forum instead, where I and others can answer you.


#21 haraldur

haraldur

    CC Resident

  • Just Joined
  • PipPipPipPip
  • 50 posts

Posted 22 November 2009 - 05:54 AM

But then i just upload the database to my site and my script adds info the the database, dont i need to update it manually myself? Can i just script to my php script that it adds automaticly to the databasem i dont need to do it manually?
  • 0

#22 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 22 November 2009 - 06:02 AM

I think you have a bit of confusion going on, based on the questions you're asking.

You'll use SQLite to store the data in the same way you would use MySQL or OpenOffice. If you ever need to update the database structure, you will need to do that in a controlled manner... maybe create a PHP file to do that and calling it once both on the server and locally.

You should not be overwriting your server database with the local copy, as you will lose accumulated data when you do that! You cannot treat a database as "just another file" and expect things to work well.
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#23 haraldur

haraldur

    CC Resident

  • Just Joined
  • PipPipPipPip
  • 50 posts

Posted 22 November 2009 - 06:03 AM

Ok, if you want to give me any more infromation, just post it here
  • 0

#24 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 22 November 2009 - 06:11 AM

You'll want to design the database and PHP code locally. Then you'll want to load all of it onto your server to start things off. Once that's done, any additional changes should be done by an "update.php" file on your server that checks the state of your database and performs updates accordingly. You would run it only once each time you update the database structure of your SQLite database. If you need special data loaded, that would be part of the "update.php" file.
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download