14, February 2012

How to Convert informix to MySQL? - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  Databases  >  MySQL
Topic: How to Convert informix to MySQL?
« previous next »
Pages: 1 [2] 3 Print
Instabuck - The easy way to sell digital products online

Author Topic: How to Convert informix to MySQL?  (Read 8632 times)
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #20 on: Jul 13, 2006, 10:37:26 am »

Code:
<?php 
//Write the data to the database

$results=mysql_query("INSERT INTO $db_table  
      VALUES ('
$rec[0]', '$rec[1]', '$date', '$rec[3]')") or

 
die('Error making query');

I get back 'Error making query'


Last blog : Are You Stumbling Yet?
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5779
46271 credits
Members referred : 3



« Reply #21 on: Jul 13, 2006, 10:40:28 am »

First try this :

Code:
<?php 
//Write the data to the database

$results=mysql_query("INSERT INTO $db_table  
      VALUES ('
$rec[0]', '$rec[1]', '$date', '$rec[3]')") or die('Mysql error : '.mysql_error().'<br />');

and let us know what is the error that it gives.

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #22 on: Jul 13, 2006, 10:41:04 am »

Ah got it, made a typo in the table name  Embarrassed


Last blog : Are You Stumbling Yet?
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5779
46271 credits
Members referred : 3



« Reply #23 on: Jul 13, 2006, 10:42:22 am »

hehe, ok Smiley

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #24 on: Jul 13, 2006, 10:44:53 am »

Oke, I do have a data problem now: the filling of the table works untill I encounter a record that has a ' in the data...


Last blog : Are You Stumbling Yet?
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5779
46271 credits
Members referred : 3



« Reply #25 on: Jul 13, 2006, 10:48:29 am »

Oke, I do have a data problem now: the filling of the table works untill I encounter a record that has a ' in the data...

That is an easy one :

Code:
<?php
$records 
explode("\n"$input); //$input = the data you have
foreach ( $records as $l )
{
    
$rec explode('|'addslashessubstr($l,0,-1) ));
    
//Do something with the $rec
}

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #26 on: Jul 13, 2006, 10:51:50 am »

thats it Grin Thanks!


Last blog : Are You Stumbling Yet?
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5779
46271 credits
Members referred : 3



« Reply #27 on: Jul 13, 2006, 10:52:50 am »

Now you should pack this and make a nice tutorial about this Smiley

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #28 on: Jul 13, 2006, 10:55:54 am »

I might just do that Wink


Last blog : Are You Stumbling Yet?
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #29 on: Jul 13, 2006, 03:29:47 pm »

oke, still not done Sad
One of the data files is quite big (50MB) I've tried a few records first to see if the conversions in my php script where working and they did. Now after trying the script on the 50MB file I get a "Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request." page.
I've just contacted the hosting provider and they say: "PHP works fine on the server, you can try to upload your custom php.ini file."
What should be in the php.ini file to fix my problem?


Last blog : Are You Stumbling Yet?
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5779
46271 credits
Members referred : 3



« Reply #30 on: Jul 13, 2006, 03:31:38 pm »

Just put this in the first line of your php file :

Code:
<?php
set_time_limit
(0);

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #31 on: Jul 13, 2006, 03:39:59 pm »

that didn't do anything Sad


Last blog : Are You Stumbling Yet?
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5779
46271 credits
Members referred : 3



« Reply #32 on: Jul 13, 2006, 03:54:58 pm »

Then the problem is the memory.

Check the memory_limit directive in the php.net site

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #33 on: Jul 13, 2006, 04:18:59 pm »

I've tried

Code:
memory_limit = 200M

in my php.ini, but that doesn't work...


Last blog : Are You Stumbling Yet?
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #34 on: Jul 13, 2006, 07:56:05 pm »

tried several other ways, but still no luck... I've now chopped the file into smaller pieces to get them in the database


Last blog : Are You Stumbling Yet?
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5779
46271 credits
Members referred : 3



« Reply #35 on: Jul 13, 2006, 09:38:41 pm »

tried several other ways, but still no luck... I've now chopped the file into smaller pieces to get them in the database

Is it working with smaller files?

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #36 on: Jul 13, 2006, 11:00:31 pm »

yes, I now have 12MB files and there is no problem with them


Last blog : Are You Stumbling Yet?
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #37 on: Jul 14, 2006, 08:58:35 am »

yes, I now have 12MB files and there is no problem with them
I have this too, tried to import 1mio addresses into a table, it doesn't work with one file. Now I use chunks with less data.


Last blog : A new Wordpress theme for our blog
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5779
46271 credits
Members referred : 3



« Reply #38 on: Jul 14, 2006, 10:05:47 am »

This is because you execute php through a web server.

If you execute the same script as CLI (from dos/console) it will be ok with any size of file, unless the operating system can't handle it.

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #39 on: Jul 14, 2006, 10:27:44 am »

This is because you execute php through a web server.

If you execute the same script as CLI (from dos/console) it will be ok with any size of file, unless the operating system can't handle it.
that should be true Wink
(I'm happy to run php code, now what next ?) Cheesy

most of the people can't run scripts because they are using a shared host...


Last blog : A new Wordpress theme for our blog
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=3192
Tags : php mysql databases php.ini Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: 1 [2] 3 Print 
Webdigity Webmaster Forums  >  Web Development  >  Databases  >  MySQL
Topic: How to Convert informix to MySQL?
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Feb 14, 2012, 09:32:51 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.