12, October 2008

How to Convert informix to MySQL? - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ 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

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



« Reply #20 on: Jul 13, 2006, 11: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: 8116
41653 credits
Members referred : 3



« Reply #21 on: Jul 13, 2006, 11: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 Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #22 on: Jul 13, 2006, 11: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: 8116
41653 credits
Members referred : 3



« Reply #23 on: Jul 13, 2006, 11:42:22 AM »

hehe, ok Smiley

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #24 on: Jul 13, 2006, 11: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: 8116
41653 credits
Members referred : 3



« Reply #25 on: Jul 13, 2006, 11: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 Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #26 on: Jul 13, 2006, 11: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: 8116
41653 credits
Members referred : 3



« Reply #27 on: Jul 13, 2006, 11:52:50 AM »

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

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #28 on: Jul 13, 2006, 11: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, 04: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: 8116
41653 credits
Members referred : 3



« Reply #30 on: Jul 13, 2006, 04: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 Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #31 on: Jul 13, 2006, 04: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: 8116
41653 credits
Members referred : 3



« Reply #32 on: Jul 13, 2006, 04:54:58 PM »

Then the problem is the memory.

Check the memory_limit directive in the php.net site Visit through proxy

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #33 on: Jul 13, 2006, 05: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, 08: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: 8116
41653 credits
Members referred : 3



« Reply #35 on: Jul 13, 2006, 10: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 Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #36 on: Jul 14, 2006, 12:00:31 AM »

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: 6349
38918 credits
Members referred : 374


It's time to use PHP5!


« Reply #37 on: Jul 14, 2006, 09: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 : Upload images for usage in TinyMCE
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8116
41653 credits
Members referred : 3



« Reply #38 on: Jul 14, 2006, 11: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 Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6349
38918 credits
Members referred : 374


It's time to use PHP5!


« Reply #39 on: Jul 14, 2006, 11: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 : Upload images for usage in TinyMCE
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....

Topic sponsors:
Get a permanent link here for $1.99!


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?
Oct 12, 2008, 04:47:43 AM





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!


Forum Statistics
Total Posts: 36.906
Total Topics: 7.558
Total Members: 4.150
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: neli67

17 Guests, 3 Users online :

13 users online today:



Readers

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