Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Require SQL info : data integrity & querrying proc

Author  Topic 

Ajoo
Starting Member

12 Posts

Posted - 2013-12-15 : 02:42:52
Hi all ! I have been learning MySQL and the gurus have been so patient and helpful. So here are some more queries from a beginner.

First is regarding the SQL query procedure from PHP. Every time a query is created and we have to go thru the following:

////////////////////////////////////////////////////////////////// query 1
query = "Select * from club";
$result = mysqli_query($link, $query);
if ($result)
{
do whatever for a successful query;
}
else
{
display or log an error
}

///////////////////////////////////////////////////////// query 2
query = "Update club
SET visit = '2';
$result = mysqli_query($link, $query);
if($result)
...

So my first question is that if we are accessing the same Table , namely clubs, in the above example, then is it not possible to avoid repetitive steps. Can't both & more statements be processed at one go or must each and every query be checked for successful execution? Is there no way to send a group query and have it processed at one go. It would greatly reduce the coding size and therefore chances of errors.

The second question is that if more than one person is accessing a database at the same time, trying to read or write into the tables, and there is a time clash, how will mysql handle it? Would it automatically queue the entries or would some of the entries be lost ? If the entries are lost, then how can this be prevented ?

Thanks all the gurus for all the help so far and that which would ensue.
Cheers !

waterduck
Aged Yak Warrior

982 Posts

Posted - 2013-12-16 : 01:20:17
maybe u can try luck in http://forums.mysql.com/
Go to Top of Page

Ajoo
Starting Member

12 Posts

Posted - 2013-12-16 : 10:55:42
Hi guys, Is this such a tough question or is it like fit for the dummy series !? Please I am sure the gurus here can easily answer this.
Thanking all in anticipation of a discussion or a reply.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-12-16 : 11:25:01
quote:
Originally posted by Ajoo

Hi guys, Is this such a tough question or is it like fit for the dummy series !? Please I am sure the gurus here can easily answer this.
Thanking all in anticipation of a discussion or a reply.


The thing is you're in the wrong forum
This is MS SQL Server forum and we deal with only Transact SQL. That was the reason you were pointed to a MySQL related forums.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

Ajoo
Starting Member

12 Posts

Posted - 2013-12-16 : 21:17:15
Oh ok! Thanks.
Go to Top of Page
   

- Advertisement -