• Announcements

    • MannDude

      Current state of vpsBoard   02/04/2017

      Dear vpsBoard members and guests:

      Over the last year or two vpsBoard activity and traffic has dwindled. I have had a change of career and interests, and as such am no longer an active member of the web hosting industry.

      Due to time constraints and new interests I no longer wish to continue to maintain vpsBoard. The web site will remain only as an archive to preserve and showcase some of the great material, guides, and industry news that has been generated by members, some of which I remain in contact to this very day and now regard as personal friends.

      I want to thank all of our members who helped make vpsBoard the fastest growing industry forum. In it's prime it was an active and ripe source of activity, news, guides and just general off-topic banter and fun.

      I wish all members and guests the very best, whether it be with your business or your personal projects.


Can I run python with php accessing the same mysql database/table at the same time?

2 posts in this topic

Hello , sorry for the confusing title ,I do not speak english as my first language.(and also sorry if the topic does not fit here)

Problem background: I just want to create a website as a competitive program grader for my school. Like complie and run source code on the server. So below is my idea and i would like some help/suggestions before i do it,I still don't know if this will work.

Mysql usage:

The problem one is that i would use one of the table as my user-submission queue.When user submit a code, I first put it in this table(i suppose it put the new row in the bottom of the table?) .

Python program usage:

I would run a 24/7 program on my server that check every 10 second  if the queue table is not empty, just run the grading process(I know how to do it) and then pop it off the queue.Then check again.


PHP usage:

When a person submit code, i will use php to put it on the queue table,but it may be the same time my python program is popping something off the queue table too. This is where I get confuse whether it will work or not.(Other usage of the php is just things about web interface which I had done before and know what to do)


So,would this idea even work? Will it break my server or something?As a competitive programmer guy I don't know much snd will greatly appreciate any help from u guys. :)


Thank you very much.

Share this post

Link to post
Share on other sites

With a real relational database you would not even need to ask. Transactions take care of this.

With MySQL, you are probably OK if the tables were created with a recent version of MySQL. Check whether they are InnoDB or MyIASM tables. If they are InnoDB it is definitely OK. If they are MyIASM I am not sure - it may be OK if it is just a single row, if there are any foreign keys pointing to it from another table them MyIASM will not be OK.

Share this post

Link to post
Share on other sites

  • Similar Content

    • By DomainBop
      CVE issued this morning : http://seclists.org/oss-sec/2016/q3/481
      detailed: http://seclists.org/oss-sec/2016/q3/att-482/MySQL-Exploit-Remote-Root-Code-Execution-Privesc-CVE-2016-6662.txt
      Percona has already issued patches.  Most other vendors however: not yet.
    • By DomainBop
      OVH offers users  the choice of using its modified custom Linux kernels or the regular distro's kernel.  Ubuntu's license contains a clause that requires anyone who distributes a modified version of Ubuntu to get approval from Ubuntu and pay a license fee to use the Ubuntu mark. Canonical/Ubuntu wants OVH to pay a licensing fee of 1-2 euros monthly for each installation which over the course of a year would amount to about 1 million euros.  According to the article Canonical (owner of Ubuntu) is also asking Dreamhost, which also uses a modified version of Ubuntu,  to pay a licensing fee.
      (google translate was invented so you could read the French articles I link to) http://www.clubic.com/pro/actualite-e-business/actualite-809784-ubuntu-canonical-payer-ovh.html
    • By fm7
      Ubuntu on Windows 10 -- The Ubuntu Userspace for Windows Developers
    • By drmike
      I am looking for a programmer / scripter already familiar with PHP and WHMCS.
      Project type work, one off  custom scripts.  Freelance work for someone out there, per piece.
      If interested, PM me your CV / resume or in lieu of such tell me about your experience.  Informal is fine, alternative learners encouraged.
    • By drmike
      I am excited by the potential of this project.  It's early yet, so cutting edge and not polished if your OS and desktop isn't what they are building for.
      Shashlik allows you to run Android apps on Ubuntu, so long as you are running KDE.   Others, good luck, try it and maybe we can help kick solutions back to the authors.
      This is for Kubuntu:
      ArchLinux and Github links over here: http://www.shashlik.io/download/
      Place you can grab famous software APKs from: http://apkpure.com/
      Someone give it a spin.  My Linux Mint environment installs it, but no dice getting anything to work.  Going to spin up VirtualBox Kubuntu install later and see if it will work under that.