[Gambas-devel] Problem with WRITE
fabien Bodard
arcalis.prod at ...4...
Mon Apr 17 17:07:31 CEST 2006
This is the code :
DIM hresult AS Result
DIM s AS String
DIM hField AS ResultField
hcon.Login = "root"
hcon.Host = "localhost"
hcon.Type = "mysql"
hcon.Name = "gambasforge"
hcon.open
'form1.show
PRINT "Content-type: text/html"
PRINT
PRINT File.Load("html")
Post["table"] = "users"
PRINT "<b>" & post["table"] & "</b><br><br>"
IF NOT IsNull(Post["table"]) THEN
'PRINT Subst("SELECT * FROM users", Post["table"])
hresult = db.Exec("SELECT * FROM " & Post["table"])
PRINT "<Table><tr bgcolor='lightgray'>"
FOR EACH hfield IN hResult.Fields
WRITE Subst("<td>&1</td>", hField.Name)
NEXT
PRINT "</tr>"
FOR EACH hResult
PRINT "<tr>"
FOR EACH hField IN hResult.Fields
WRITE Subst("<td>&1</td>", hResult[hField.Name])
NEXT
PRINT "</tr>"
NEXT
PRINT "</Table>"
ENDIF
This is what i get :
Look between the </td><td> i've some space ... some ')' and some ASC 10 and
others..; i think it's not normal ! Am i wrong ?
<form action="index.cgi" method="POST">
<input type="text" name="table" id="table" value="">
<input type="submit" name="toti" id="toti" value="coucou">
</form>
<b>users</b><br><br>
<Table><tr bgcolor='lightgray'>
<td>idusers</td> <td>creadate</td> <td>login</td> <td>passw</td>
<td>email</td> <td>admin</td> <td>photoactivate</td></tr>
<tr>
<td>1</td> <td>1100386859</td>
<td>gambix</td>)<td>5d933eef19aee7da192608de61b6c23d</td>
<td>abidoo.too at ...4...</td>
<td>2</td> <td></td></tr>
<tr>
<td>2</td> <td>1100386859</td>
<td>bidoo</td>)<td>17fb812d2bf6cb65dc05fb45bdccbaea</td>
<td>abidoo.too at ...4...</td>
<td>0</td> <td></td></tr>
<tr>
<td>3</td> <td>1100386859</td>
<td>lordheavy</td>)<td>ec15590a3d3a798d0382d84570f964e8</td>
<td>lordheavy at ...141...</td>
<td>1</td> <td></td></tr>
<tr>
<td>4</td> <td>1100386859</td>
<td>LaurentC</td>)<td>04d8c425cc03ec3f918500848084a04f</td>
<td>lordheavy at ...141...</td>
<td>0</td> <td></td></tr>
<tr>
<td>5</td> <td>1100386859</td>
<td>RGCook</td>)<td>11ace34f612341c3da418085af222411</td>
<td>rgcook at ...456...</td>
<td>0</td> <td></td></tr>
<tr>
Regards,
Fabien Bodard
More information about the Devel
mailing list