0

Just before the actual question, I have found some sites showing how to do this but they were using the old mysql method. I am looking for a PDO method.

So I am trying to update an MySQL row (only one column) using PHP and html. All I have is an variable that points to the column I want:

$about = DB::query('SELECT about FROM users WHERE username=:username',
                   array(':username'=>$_GET['username']))[0]['about'];

And I want to have an with textarea and a button that are updating the row.

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
  • Ok so that looks like it fetches the data from MYSQL to PHP. Are you expecting us to write all the rest or the code you say you require **????** Thats not how SO works. **You** code it, and if you have problems **we try and help you fix it**. – RiggsFolly Jun 20 '17 at 23:35
  • `UPDATE user SET about = :about WHERE username=:username` – RiggsFolly Jun 20 '17 at 23:40
  • @RiggsFolly 1. I am looking for an 1-line query 2. Your edit is wrong. It's one line, not two lines. – Dimitar Bogdanov Jun 20 '17 at 23:41
  • But it does not have to be coded on one liner. and as I had it we can actually read it without scrolling – RiggsFolly Jun 20 '17 at 23:44
  • I would not have changed it if I believed I was changing anything syntactically important – RiggsFolly Jun 20 '17 at 23:44
  • And I am not sure how this _And I want to have an with textarea and a button that are updating the row._ could be answered in 1 Line – RiggsFolly Jun 20 '17 at 23:47

0 Answers0