New answers tagged

1

It is bad practice to denormalize as you state. Depending on your search criteria, any one of the four tables could be chosen by the query optimization routine. If you are selecting on a package selected from a drop-down list, there should be no reason to add the packages table to the query as you can match the package_id in the package_durations table. ...


0

Problem: It's possible for a user to see an empty or incomplete list. Problem: It's possible for the user to see duplicate entries. I suspect that you are not using Transactions when making these updates. With Transactions, users will only see the end result of your [transactional] manipulations. They will never see the intermediate state where ...


0

I can think of two ways to approach this problem. If the list is small enough ...just wrap your update in a transaction and set your transaction isolation level so that users querying the table will be blocked until the update is complete. If the list is very large ...or has complicated relationships (probably does not apply in this specific case), add a ...


1

My idea is simply save your query result to SQLite db, then upload it to your hosting, also add method to check if the db has changes, if yes then on your android download it, this method is suitable for db with minimal changes.


5

Short answer, no. But mysql_real_escape_string isn't the only thing that protects you here. See : $text = mysql_real_escape_string($_POST['text']); // $_POST['text'] == "1 OR 1=1" $result = mysql_query("SELECT * FROM login WHERE id = $text"); You're not protected here, and an injection was made. So your quotes are protecting you against this here. You ...


3

Dynamic IP doesn't mean it's offline. If your server connected to internet even with dynamic IP, use Dynamic DNS service like dyndns.org, and your android apps still can connect to your server. It's much simpler than having two server that need synchronization And the best practice for android app is to connect to a web service, not connect directly to a ...


3

Use an ETL tool. You can start with Pentaho Kettle http://community.pentaho.com/projects/data-integration/ which is in my opinion the best open source ETL tool available. Create a transformation, save it, and schedule it.


0

Maybe in your case - having centers and radius would be easier, instead of combining the circles, just to check if the distance of the user to the centers of the drivers is less that the given radius. Something like: SELECT * from drivers where ST_DISTANCE(drivers.center, POINT([user.lon],[user.lat])) < drivers.radius; /* assuming drivers.center is of ...



Top 50 recent answers are included