Migrate PHP code from MSSQL to MySQL[duplicated] - php

I currently have a large web application that connects to MSSQL to fetch its data. This web app has hundreds of .php files. I have a new customer, and he doesn't want to use MSSQL, but MySQL instead.
I've searched and found lots of articles on how to migrate data. But that's not my problem. I know how to do that, besides we'll be starting with a blank database, except for a few default catalogs.
Any help greatly appreciated

Related

Need some pointers on adapting a php/mysql pagination script for use with odbc .mdb access database

Im working on a little web based application using php/html and an odbc database. Im trying to figure out how to implement pagination into the application im making, but the only examples I could find were made with mysql and not odbc. I've tried for hours to adapt them, but have come up empty handed so far.
I've replaced every instance of mysql from the script with odbc and dreamweaver is picking them up as valid functions (color highlighting) but the script is producing nothing.
The script I was working off of is located here:
http://www.developphp.com/view_lesson.php?v=289
I appreciate any help, even if its just a link... Been kicking myself in the head over this for too long.
You might find this tutorial useful.
http://www.shotdev.com/php/php-access/php-access-odbc-and-paging-pagination/

Why does my MySQL database tables only exist on my Workbench?

I am developing my first php-MySQL system, but have a minimum of database experience. I have successfully created a schema with aproximately 10 tables, and the testings have so far worked fine.
My problems started when i created a dump of the database, as copy for my laptop, so I could continue to test new web pages and new queries even when I am not at home, and still use a localhosted database.
I have successfully imported the dump, and created the schema in my workbench, and it is visible from the command-line prompt "show databases".
However, both my web application, and the command-line prompts are unable to locate the underlying tables. THe problem is at least not directly in my php-code, as it works perfectly on another computer, with another, but assumably identical localhosted database. I have researched the matter online for what feels like a decade, but without any relevant results.
Command-line prompts are able to find tables from every other schema, like the sakila examples. I have tried to compare the two's settings, but they all seem to be identical, for instance they are both InnoDB.
I realise that I am not giving enough information for a direct solution here, but I would greatly appreciate if anyone could hguide me to finding the right questions to ask, so I can solve this matter, and get on with my php-learning.
(SOLVED)
I discovered that the list of open tables had references to an additional Schema. I thereafter realised that I had installed the XAMPP bundle server before I installed MySQL Workbench. In other words, i already had an existing database, with all of the regular examples included in another instance, which were running on port 3306. It also happpened to have an identical, but empty scheme, of the name that I tried to access.
My newly added SQL installation was ported to 3307, and so I am now able to access it. THis issue was just one of several issues I have been able to work around, but they have all been caused by the same mistake. Thanks everyone for trying to help.

Old Mysql to new Mysql?

I was learning some web design about 18+ months ago and got caught up on some other things and had to stop for a while. I'm getting back into web design again. I used xampp back then and using xampp now also. I found my old xampp zip of the entire folder. I extracted it thinking I might get lucky and get my databases back from mysql. I go into the xampp\mysql\data and I copied all the folders with the databases I wanted to put into the new mysql. I loaded up phpmyadmin and the databases are there but they are all empty.
The main database I want to save has these files inside of it...
db.opt
pcms_categories.frm
pcms_meta.frm
pcms_posts.frm
pcms_users.frm
so I see the table files there but mysql isn't loading them. I assume maybe it's an older version and it won't read these files because they are obsolete. I'm not sure. After transferring the files I stopped mysql and reloaded it so just wanted to mention that.
It's been so long ago that it doesn't exactly matter if I can recover this data. I was working on a blog though would be cool to get that back and finish what I started.
try to dump it to .sql perhaps?
in other word, export/import.
First, I'd check for permission issues. MySQL usually requires special permissions on its datafiles. Check to see if MySQL has created its own user/group. Next, I'd try to find out what version of MySQL you previously had, create an installation of said version, and use it to dump the datafiles to SQL.

How to access an SQLite database file stored on cd using php?

I have a small mySQL database and a few simple php based webpages that query the database, generate html tables and present them in the browser. The database is no longer being updated. So, searching and viewing subsets of the data is all that is required.
Some users are interested in distributing the searchable database on a cd or usb memory stick. SQLite seems to offer the answer, but I don't understand what is needed to make this work. What will be required to make a web browser based "app" work from a memory stick in the absence of a server like xampp?
XAMPP Lite from http://portableapps.com/apps/development/xampp
What you want is called a "standalone server". This is very common in almost every other modern language except PHP, for some reason. Googling "standalone php server" reveals several options:
QuickPHP
Nanoweb
Server2Go

Extremely basic PHP and Mysql

Background: I am more of a designer than a programmer, but have hacked templates for many open source CMS's (Drupal, Joomla, Wordpress)
I want to start from scratch in regards to the relations of php and a mysql database.
Lets assume I have a working database and php engine locally.
What would be my first step to connecting to my database and creating a table... (im happy to be led to an appropriate tutorial...)
Many of the tutorials I have seen start with basic php, but I would rather explore the connection between the db and the php.
This seems to be a pretty good tutorial:
http://www.freewebmasterhelp.com/tutorials/phpmysql
W3Schools has a big tutorial on both PHP and MySQL.
A useful tip is also to know that you can look up anything you need on the official PHP and MySQL support pages by going to
php.net/search-term-here (example)
mysql.com/search-term-here (example)
If you want to really get a leg up... see if you can get programs like CPanel and PHPMyAdmin.
PHPMyAdmin will give you a more familiar UI for database control and ease you into using mySQL.
There are two ways: start to learn SQL and create tables trough SQL or use PHPMyAdmin to administer the database. From then on you only have to learn how to get the data from the database.
PhpMyAdmin also displays the queries so you can analyze these.
Get into PDO . It's gonna be the next big php/mysql thing. A lot of sites have switched to it. It's simple and securer than conventional mysql_* . A good book (for beginners and to start you going) that is for sure not for production is Wicked Cool Php Scripts
You can also have a look at XAMPP, which makes installing everything required for PHP/MySQL a breeze. Linux, Windows? No problem.
Nettuts and theme forest blog have a nice video series on learning php. They have other series such as wordpress and are currently doing a series on code ignitor which both use php.
Install mySQL and look up basic tutorials on how to create a table, update, etc. Once you feel handy with that, install XAMPP lite, where you can start practicing PHP. Look up tutorials on how to use PHP to access your database. XAMPP also has phpMyAdmin, so you have a much easier interface to work with your databases.
It'd be good if you had some basic programming knowledge too-- it makes understanding PHP significantly easier.
This is an example on how you connect php to your database:
<?php
$dbh = new PDO('mysql:host=localhost;dbname=test', 'root', '');
?>
mysql = database driver
host = localhost or 127.0.0.1
dbname = your database name
'root' = your database username
'' = database password
*Visit and explore this link for more info about PHP with Database.

Categories