What is wrong with the "update" row :-O.... it is showing some syntax error !! plz sombody rply soon !!!!!!

$sql="SELECT * FROM contact";
$result=mysql_query($sql);?>
<table align="center" width="700" border="0"><tr><td><?php
echo "<form name='form1' method=post action=''>"; 
echo "<table border='0' cellspacing='0' cellpadding='2' width='600' align='center'>"; 
echo"<tr bgcolor='#ffffff'>";
echo"<td>&nbsp;</td>";
echo"<td align='center' bgcolor='#FFFFFF'><strong>emailid</strong></td>";
echo"<td align='center' bgcolor='#FFFFFF'><strong>forwarding</strong></td>";
echo"<td align='center' bgcolor='#FFFFFF'><strong>autoresponse</strong></td>";
echo"<td align='center' bgcolor='#FFFFFF'><strong>company</strong></td>";
echo"<td align='center' bgcolor='#FFFFFF'><strong>Password</strong></td>";
echo"<td align='center' bgcolor='#FFFFFF'>UPDATE</td></tr>";
while($rows=mysql_fetch_array($result)){

echo"<tr bgcolor='#ffffff'>";
echo"<td>";
echo"<input type = 'checkbox' name='box[]' value=\"".$rows['emailid']."\"'</td>";
echo"<td align='center' bgcolor='#FFFFFF'>".$rows['emailid']."</td>";
echo"<td align='center' bgcolor='#FFFFFF'>".$rows['forwarding']."</td>";
echo"<td align='center' bgcolor='#FFFFFF'>".$rows['autoresponse']."</td>";
echo"<td align='center' bgcolor='#FFFFFF'>".$rows['company']."</td>";
echo"<td align='center' bgcolor='#FFFFFF'>".$rows['password']."</td>";
echo"<td>"<a href=\"update.php?emailid=<? echo ".$rows['emailid']."; ?>\">update</a></td></tr>";
}

?>

Hi,

$sql="SELECT * FROM users";
$result=mysql_query($sql);?>
<table align="center" width="700" border="0"><tr><td><?php
echo "<form name='form1' method=post action=''>"; 
echo "<table border='0' cellspacing='0' cellpadding='2' width='600' align='center'>"; 
echo"<tr bgcolor='#ffffff'>";
echo"<td>&nbsp;</td>";
echo"<td align='center' bgcolor='#FFFFFF'><strong>emailid</strong></td>";
echo"<td align='center' bgcolor='#FFFFFF'><strong>forwarding</strong></td>";
echo"<td align='center' bgcolor='#FFFFFF'><strong>autoresponse</strong></td>";
echo"<td align='center' bgcolor='#FFFFFF'><strong>company</strong></td>";
echo"<td align='center' bgcolor='#FFFFFF'><strong>Password</strong></td>";
echo"<td align='center' bgcolor='#FFFFFF'>UPDATE</td></tr>";
while($rows=mysql_fetch_array($result)){

echo"<tr bgcolor='#ffffff'>";
echo"<td>";
echo"<input type = 'checkbox' name='box[]' value=\"".$rows['emailid']."\"'</td>";
echo"<td align='center' bgcolor='#FFFFFF'>".$rows['emailid']."</td>";
echo"<td align='center' bgcolor='#FFFFFF'>".$rows['forwarding']."</td>";
echo"<td align='center' bgcolor='#FFFFFF'>".$rows['autoresponse']."</td>";
echo"<td align='center' bgcolor='#FFFFFF'>".$rows['company']."</td>";
echo"<td align='center' bgcolor='#FFFFFF'>".$rows['password']."</td>";
echo"<td><a href=\"update.php?emailid=".$rows['emailid']."\">update</a></td></tr>";
}

In PHP, Be aware of the single and double quotes when using in your code.

types.string

paulrajj----------Thank u so so so so so so soooo much :).. i was eating my head since morning for this !! :(

And make things easier for your self in the future.

learn how to insert php quick tags in html.

Very handy :)

yes i want to learn ... but how :/

[form]
[input type='text' name='username' value='<?=$value?>']


[/form]

The little php snippet inside the form input value.

Are you getting the idea??
:)

Hold your breath,

Php tag <?=$foo?> can not be turn off.

this is not asp tag
<% ... %>

Trust me i host up to 468 customers website on my server and i know that any hosting company turning this off will be out of business in 2 minutes.

The php short tags are always available on default. The asp type is optional

;) explore

richieking

u seem 2 be an expert in PHP :O .. plz plz plz be there 4 me always :( .. m a newcomer in php .. and dat 2 in a job :/

Short tags can definitely be disabled, however they are enabled by default.

If they are disabled, there are ways to use a stream wrapper to replace <?= to <?php echo on the the fly, but its merely a workaround.

RTM

Yes but they are not and wont be disabled by php.

Lets set the record straight. The short tags are one of php selling point.

And no web hosting services will dare to disable that. The short and long tag of php are php.

The asp style is only to show off. Its not part of php core.

explore :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.