values for existing contols

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
shiranwas
Forum Commoner
Posts: 53
Joined: Fri Jul 07, 2006 10:41 pm
Location: Colombo

values for existing contols

Post by shiranwas »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


hi,

 I have alredy created a php page as follows, I want to pasa a value from function to a existing
control how to do that, please help me.

Code: Select all

<html>
<body>

<?php

function a(){
$h="localhost";
$p="shiran";
$u="root";

$dbh=mysql_connect($h,$u,$p) or die("Can not connect to the server");

mysql_select_db("call");

$result= MYSQL_QUERY("Select * from call_details" );

$row=mysql_fetch_ASSOC($result);

return($row['refno']) ;


}

?>

<input type="text" name="ref"  />

</html>
</body>
thanks

shiran


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Write the return value into the control's value.
Post Reply