Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If I've understood your question then the answer is "no". This isn't a mysql specific issue either, it's a generic SQL question. I'd strongly recommend going through an SQL tutorial, the best one I know if is here: </p> <p><a href="http://philip.greenspun.com/sql/" rel="nofollow noreferrer">http://philip.greenspun.com/sql/</a></p> <p>To answer your question, you should be able to do:</p> <pre><code>mysql_query("UPDATE login SET foo = '$cleanurl'"); </code></pre> <p>where "foo" is the name of the tenth field. </p> <p>A few other comments though:</p> <p>Firstly, don't rely on the position of your fields, always explicitly list the field names. For example, it's better to go</p> <pre><code>INSERT INTO login (id, name) VALUES (1, 'Fred') </code></pre> <p>instead of </p> <pre><code>INSERT INTO login VALUES (1, 'Fred') </code></pre> <p>Point 2: You have directly embedded the value of $cleanurl into your query. Of course, you have to learn one thing at a time but be aware that this is very dangerous. If $cleanurl contains something like "'); DROP TABLE login;" then you might be in trouble. This is called SQL injection and is the source of constant security problems. Without going into too much detail, you should learn how to use prepared statements. </p> <p>Point 3: PHP comes with a library called PDO which supports prepared statements. It also provides a common API for interacting with your database so if you find that you need to move from Mysql to another DBMS, PDO will abstract away most of the differences. By using the mysql_query function you lock yourself into using mysql.</p> <p>You don't have to address all of these issues simultaneously but don't forget about them either, once you get familiar with PHP and SQL come back to the points about PDO and prepared statements.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload