how to automatically repair table if crashed [closed] - php

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
sometimes if a table is marked as crashed, a simple
REPAIR TABLE `tablename`
works fine to continue.
how do I add an automatic repair in my PHP script?
I get the error:
1194 - Table 'whos_online' is marked as crashed and should be repaired

This is very unlikely to make sense.
If you need to repair tables so frequently that you need to automate it, there's something wrong with your setup. You need to fix the root cause in that case.
An automated solution would also be difficult to implement. You'd have to parse the mySQL error message to find out whether the reason your query failed is maybe related to a broken table. There are thousands of different possible reasons why a query could fail.
The usual way is to monitor what is going on on the web site, and having an administrator react to problems. You could, for example, have your web app send you an E-Mail when a query fails.

Related

How do I create and run the custom database? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
When I created my pet site and visiting it. I noticed money systems and pet systems all need database for them. But I'm wondering is there any way to create new rows for money system? I need money system for that to purchase virtual pets and itens.
So is there any codes when i click on a thing in the site that adds or removes from database date? Thank you a lot!
I thought that follows that code before I know DB:
<?php
$coin=50;
?>
There are no 'magic buttons' working out of the box - you can get that kind of button but you need to create DB structure, connection, write proper functions/methods (depends on your coding approach) and then bind it to that button.
Even if you are going to use some package/plugin or whatever you find useful - you need to have configured DB to be able to use that.
It is even hard to send you some links with examples/documentation as you did not give any kind of information regarding what (I guess) CMS or service you are using.
Deliver more info and then there is a chance that someone will be able to help.

Inserting Data - SQL and PHP [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
So, I don't completely understand how sql databases and servers work together. Tell me if I'm wrong. Okay, so, I can use Php to insert data into an SQL Database that is set up on the same server that is hosting the website? (Question edited)
If your server is from a third party, they may provide you with a tool such as phpMyAdmin. You can use this tool to create your database and insert information into it. That is, you don't necessarily need a server side language to create and insert data in a database. That said, you will need a server side language or framework to access and manipulate that data in your web applications.
If you are running your own server, you can install phpMYAdmin on it and do the same.

will lots of people on website overload database? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a website run by php. I have about 80 users that will be signing up within a hour period.
my question is are there any problems that could occur when having lots of people accessing my database all at once?
I mean 80 users is a lot for me, and if some of you people that have way more than that are laughing at me, how many people would it take to mess up a database?
Thanks in advance!
You could use a tool like apachebench to check. Then you could use tools like memcached (or memcachedb if you needed persistence) to dial down the mysql queries. I would also set up mysql slow query logging.

database on php only server [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am trying to create a site with a tiny CMS, the problem is that there is only php installed on the server.
The site will mainly consit of two pages the user page and admin page. On the user page there is to be a bunch of checkboxes which when checked will do some math(not the problem I need solved). On the admin page you need to be able to add the checkboxes and assing them their values.
My approach was to read and write to a XML file that contains the data instead of a database. I have run into a lot of problems trying to accomplish this, and I am looking for some good ideas for how it can be done, or alternatives.
Thanks in advance.
You can use sqlite as database engine. This way you also create a portable version of your application and by using PDO you could always switch to another database engine later on.

Lose of data updating PHP and MySQL? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have asked one of my hostings to update the version of PHP and MySQL and they have replied telling me to be sure I have a backup of my databases as well as of the content of the page because during the update some data can be lost.
Is this just a way to cover their back in case of any incompetent doing bad their job? Or can it really result in a potential lose of data for some reason?
I am not really on the mod of downloading all the site, which is quite big and with thousands of images, and I was wondering which are the probabilities of suffering lose of data in this operation.
Thanks.
This is a normal procedure of any hosting company to inform their clients to perfom a backup before they touch the server. I think its more to do with technology. Things can go wrong regardless of how well the person is trained. I advice you in addition to making this backup, to have a regular backup schedule for your website in case things go wrong in the future.
This is not a question that anybody can really answer here.
Normally updating the versions of php and MySQL shouldn't cause any problems but like with everything in life - it can go wrong... J
So you can never be mistaken to have a recent backup at hand.

Categories