Jump to content

Archived

This topic is now archived and is closed to further replies.

fanta1066

Get value of field in table

Recommended Posts

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

 

 

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

×

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.