Jump to content

Snewzzer

Members
  • Posts

    16
  • Joined

  • Last visited

Everything posted by Snewzzer

  1. Jacques1, if I had to rewrite ALL of my code it wouldn't take too long! It consists of only two very short files which I only began a few nights ago. So I can throw everything out and start again... which I am doing now, starting with the php manual. Thanks.
  2. Jacques1, yes I will do, and thanks for everything. But no, I'm not in a hurry, this is a personal project of no great importance. It was such a simple query that I expected there might be a simple answer. I am returning to coding after a 4 year gap, I was a newbie then and still am now, so will endeavour to learn the current correct methods. Thanks again.
  3. The following works:- $sql = "SELECT colname FROM tablename WHERE name = 'Joe'"; $record = mysqli_query($con,$sql); $row = mysqli_fetch_row($record); echo $row[0]; But are you saying that I can't use this anymore?
  4. Just to clarify, maybe I wasn't clear enough. I want to retrieve a single value using the mysql statement above and assign this to a php variable. Thanks.
  5. Just gave the above code example of one of dozens that I have tried, this seemed the simplest to try and convey what I was trying to achieve. I'm only trying PDO on the suggestion of Benanamen, but give me a simpler way if there is one and I will use that. Newbie, 4 years since I last wrote any code.
  6. fetchColumn is giving me the error message - Undefined variable: pdo
  7. Thanks Benanamen, looks like it's fetchColumn that I should be using, will give it a try.
  8. Thanks Jacques1, my code(which doesn't work !) for fetching a single value is:- $result= mysql_result(mysql_query("SELECT colname FROM table WHERE players = 'name'")); So if I have to fetch a row, how do I extract the single value that I need?
  9. I just want some php code to retrieve a single value from my mysql database, sounds simple, I know the mysqli query but not the php command to use. Have tried everything I can see on the web but nothing works... help!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.