Jump to content

Iklekid

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Posts posted by Iklekid

  1. Cant you setup the database backup through the Vbulletin admin control panel? Surely there msut be a way to jsut upload the file to restore it!

     

    I havent used vbulletin (adminCp) anyways, I use IPB and i can easily backup/restore a database in their!

     

    Am i following you right on this or have i read your post wrong?

  2. thanks very much it worked, except for one thing, when I run it it changes all accounts mines to 1,000 of each! it dosent add on their original amount of mines they had before

     

    for example

     

    planet a

    has

     

    234 metal mines

    364 crystal mines

     

    when i run the script it then sets its values as

     

    1000 metal mines

    1000 crystal mines

     

    I want it to set it as

     

    1234 metal mines

    1364 metal mines

     

    Thanks for your continued help!

     

    Iklekid :D

  3. Thanks for your reply, once sorting the ariables in the code I end up with this

     

    <?php 
    
    
    
    # assuming you have all these fields: 
    
    #  id = user id 
    
    #  crystal_asteroids = number of crystal asteroids 
    
    #  metal_asteroids = number of crystal asteroids 
    
    
    
    $resultGET = mysql_query("SELECT (id,crystal_asteroids,metal_asteroids) FROM pa_users ORDER BY id ASC") or die(mysql_error()); 
    
    while ($row = mysql_fetch_array($resultGET)) { 
    
     $newCA = $row[\'crystal_asteroids\']+1000; 
    
     $newMA = $row[\'metal_asteroids\']+1000; 
    
    
    
     mysql_query("UPDATE pa_users SET (crystal_asteroids=\'".$newCA."\',metal_asteroids=\'".$newMA."\') WHERE id=\'".$row[\'id\']."\'") or die(mysql_error()); 
    
    } 
    
    
    
    ?> 

     

    Unfortunately when I execute the file i get this error

     

    You have an error in your SQL syntax near \'crystal_asteroids,metal_asteroids) FROM pa_users ORDER BY id ASC\' at line 1

     

    Any Ideas?

     

    Thnask very much :-)

  4. Hi, I have a table in my database that has players details, one set of these details are crystal_asteroids and metal_asteroids!

     

    I was wondering if their was a mysql query that I could run that would add the value 1000 to each of details. It msut add it to every player in the table!

     

    For example if player 34 had currently 354 crystal_asteroids and 354 metal_asteroids, I would like to add 1,000 of each so he has a nw total of 1,354 crysatl_asteroids and 1,354 metal asteroids.

     

    To manually change this for every player is very time consumming as seen as there is over 100 players!

     

    Is there a query I could run then??

     

    Thanks Very much in advance

     

    Iklekid

  5. Hi I am using the script U have created but it dosent seem to want to work!

     

    I have a cron tab set to wrok at midnight

     

    the cron command is

     

    php /home/dwog/public_html/*****/dbsender.php > dev/nul

    I am asking for it to email me the fille, I have chmod the directory but still no luck.

     

    Any ideas?

     

    Thanks

  6. <?php  

     

    $filename = \\\"mysqldb\\\".time().\\\".sql\\\";  

     

    passthru(\\\"mysqldump -u (username) -p(password) --opt (database_name) > /my/backup/directory/$filename\\\");  

    ?>

     

    Do i replace the /my/backup/directory with my full server path to a folder I would like the backups put into??

     

    And also do i jsut do a wget fucntion in the cron tab command?

     

    Thanks

     

    Iklekid

  7. ok go to phpmyadmin Create a databs (unless you already have one) if so from the drop down list on the left select the databse.

     

    When the new page loads go to SQL

     

    You will see a large text box either paste the contents of .sql file into there (open the file with notepad) or clcik on browse and select the file from your hard drive! then clcik run! It will then execute the commands in the .sql file and install the tables and data into your databse!

     

    Iklekid

     

    PS would be wise to back up any of your databses jsut in case you make a mistake :)

  8. Do you have Phpmyadmin installed on your webhost? If not i recommend you get it!

     

    Once in there you can manage all of your tables instantly!

     

    To do what you are saying in uploading a table with data then you can simply copy and past the text inside the .sql file into phpmyadmin or upload the file! It will then run and bingo you have your database up :-)

  9. Hi I would like to make a back up of my websites myswl databse everyday at midnight! I have been told that I can do this using a crontab! I have crontabs on my server but I dont know what coding/command line on the cron tab to use! There is only one databse I would like to back up! Anyoen know how to do this?

     

    Thanks in advance for any help!

     

    Iklekid :D

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.