Jump to content


Photo

Get value of field in table


  • Please log in to reply
1 reply to this topic

#1 fanta1066

fanta1066
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 18 October 2005 - 09:23 PM

Can some one please advise me with some sample code.

Basically I have a table in MYSQL and within this table I have a field called record_number. Obviously its an Integer and it auto increments.

within an HTML form with php code all I want is to display the value of this field + 1

So in other words if the value of record_number is 15 in the table and when the HTML form is launched the PHP code will interrogate the table get the value and some where on my form it will state the following.

Record Number = 16

Please can some one give me some real code that I could use.

thanks

Please email code to h.ghelani@rbht.nhs.uk




#2 khuti

khuti
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 20 October 2005 - 05:52 AM

hi, i think ur starting out in sumthing too deep personally, if u no anything about programming u would no how easy it is to do that.. i would suggest starting off with sumink like vbscript.. its not used much these days but its easy to get to grips with. once u understand the conecept of programmin.. things like this n javascript will b much easier.

anywho what u wana do is call the field from the database isnt a variable so like..

$record_no = $row['tables_field_name'] + 1;

then u display it like..

echo("recored number: " . $record_no . " - ");

if u dont no how to do the rest of the code like a database connection n query or if none of this makes any sense. id would seriously giv up on this stuff for now. go learn sumink easier like i said above. n come bk to this later when ur feeling more comfortable with programmin.

:D

hope this helps, khuti




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users