SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 23/09/2018, 01:50 PM   #21
Doddinger
Little Clucker
 
Join Date: Sep 2018
Posts: 35
Reputation: 0
Default Re: MySQL doesn't update the row/s -.-

I have to use SELECT if I'm using the INSERT INTO cmd.

Problem solved.

Greetings
Doddinger is offline   Reply With Quote
Old 23/09/2018, 02:37 PM   #22
v1k1nG
Huge Clucker
 
v1k1nG's Avatar
 
Join Date: Feb 2018
Posts: 411
Reputation: 31
Default Re: MySQL doesn't update the row/s -.-

INSERT doesn't UPDATE
v1k1nG is offline   Reply With Quote
Old 23/09/2018, 06:47 PM   #23
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,817
Reputation: 831
Default Re: MySQL doesn't update the row/s -.-

Ok here is a brief:

INSERT - add a new row into table (doesn't need a WHERE clause)
SELECT - fetch data from database with an optional condition if provided (WHERE clause optional)
UPDATE - update an existing row(s) (WHERE clause optional)

https://www.w3schools.com/sql/sql_insert.asp
https://www.w3schools.com/sql/sql_select.asp
https://www.w3schools.com/sql/sql_update.asp

Tip: you use SELECT statement to check if a row exist before updating, you can also perform both in one query.
__________________

My GitHub:

Gammix is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Doesn't update position vassilis Scripting Help 0 06/12/2016 11:44 PM
Doesn't update label vassilis Scripting Help 11 03/12/2015 11:58 PM
MySQL doesn't update table? [XST]O_x Scripting Help 8 22/06/2015 04:07 PM
Pwn doesn't update amx? jremi Scripting Help 1 12/07/2014 03:37 AM
Textdraw doesn't update Biess Scripting Help 1 25/12/2012 03:25 PM


All times are GMT. The time now is 02:13 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.