Username: Save?
Password:
Home Forum Links Search Login Register*
    News: Welcome to the TechnoWorldInc! Community!
Recent Updates
[April 24, 2024, 11:48:22 AM]

[April 24, 2024, 11:48:22 AM]

[April 24, 2024, 11:48:22 AM]

[April 24, 2024, 11:48:22 AM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[February 14, 2024, 02:00:39 PM]
Subscriptions
Get Latest Tech Updates For Free!
Resources
   Travelikers
   Funistan
   PrettyGalz
   Techlap
   FreeThemes
   Videsta
   Glamistan
   BachatMela
   GlamGalz
   Techzug
   Vidsage
   Funzug
   WorldHostInc
   Funfani
   FilmyMama
   Uploaded.Tech
   MegaPixelShop
   Netens
   Funotic
   FreeJobsInc
   FilesPark
Participate in the fastest growing Technical Encyclopedia! This website is 100% Free. Please register or login using the login box above if you have already registered. You will need to be logged in to reply, make new topics and to access all the areas. Registration is free! Click Here To Register.
+ Techno World Inc - The Best Technical Encyclopedia Online! » Forum » THE TECHNO CLUB [ TECHNOWORLDINC.COM ] » Programming Zone » PHP
 Deleted MySQL table by mistake regenerate by PHP
Pages: [1]   Go Down
  Print  
Author Topic: Deleted MySQL table by mistake regenerate by PHP  (Read 974 times)
Hellraiser
TWI Trailblazer
*******



Karma: 3
Offline Offline

Posts: 2476


View Profile
Deleted MySQL table by mistake regenerate by PHP
« Posted: August 29, 2007, 10:43:59 AM »


Deleted MySQL table by mistake regenerate by PHP

The condition is you should have the values of the database stored in a string, Hey don't make that face it is not that bad. There is a chance that you have the data written somewhere. For example assume the table deleted had details of all employees like name, telephone no++, so there is a chance that this info was initially saved in a word or excel document. All you have to do is cut paste the data and save it as a string like the way I have mentioned below.

Example

Here is an example to populate a languages table:

It is useful when you have a junk of values and no time or patience to sit and retype or copy paste:
Code:
$string="Arabic!English!Afrikaans!Farsi!Hebrew!Hindi!Malay!Malayalam!Tamil!Gujarati!Urdu!Konkani!Marathi!Telugu!Albanian!Armenian!Bulgarian!Cantonese!Chinese!Croatian!Czech!Danish!Dutch!Ethiopian!Finnish!French!German!Greek!Hungarian!Indonesian!Italian!Japanese!Korean!Mandarin!Norwegian!Polish!Portuguese!Romanian!Russian!Serbian!Sinhala!Slovakian!Slovenian!Spanish!Swahili!Swedish!Tagalog!Taiwanese!Thai!Turkish!Ukrainian!Vietnamese";


$arr=explode("!",$string); //converts the string into an array where it finds "!"

$j=0;

for ($i=0;$i<47;$i++)

{�
�� for($j=$j;$j<$i; $j++)
������ {
������� echo "INSERT INTO `languages` ( `sno` , `languages` ) VALUES ('$i', '$arr[$j]');"."
";
� }
}

Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Copyright © 2006-2023 TechnoWorldInc.com. All Rights Reserved. Privacy Policy | Disclaimer
Page created in 0.114 seconds with 25 queries.