Page 2 of 2
Posted: Sat Mar 05, 2005 1:20 pm
by 2bran
when i view the source code it simply shows the html tags and the body tags nothing else. !
The thing it is it does display echo statments but not when i run them after queries, either way it should display the errors becasue i've seen it before.
Posted: Sat Mar 05, 2005 1:33 pm
by smpdawg
Does your code actually say this? I am specifically asking about the space after the $.
Code: Select all
$ Connection= mysql_connect("", "", "");
here is another script example
Posted: Sat Mar 05, 2005 5:23 pm
by 2bran
This is another example of a script i worte which when opened connects straight to the database and retrives one specific field. The
customer ID.
Its a bit simpler so u may see something worng but the $connectiion has no space.
Code: Select all
<?PHP
$connection = mysql_pconnect
("","",");
$result = mysql_query ("select CustomerID from customers ORDER BY DESC LIMIT 1")
while ($row = mysql_fetch_array($result))
{
echo "<table border=1 cellspacing=0><tr><td>Title</td></tr>"';
echo "<tr>";
echo "<td>" . $rowї'CustomerID'] . "</td>";
echo "</tr>"
echo "</table>"
}
echo '<a href="Job details.htm">To enter job details click here</a>';
?>
if you can see anything wrong please let me know.
william
Posted: Sat Mar 05, 2005 5:35 pm
by smpdawg
select CustomerID from customers ORDER BY DESC LIMIT 1
I assume that since DESC is in caps, you were intending to do a descending sort but you haven't specificed a field to sort. It should be something like.
ORDER BY fieldname DESC LIMIT 1
If DESC is a field name, it is invalid because DESC is a reserved word in SQL.
2bran
Posted: Sat Mar 05, 2005 6:32 pm
by 2bran
hey cheers man
really beginning to get somewhere now the table is being echoed out but no information inside.
At least its a start, i think it becasue i'mnot declaring any variables. hmmm.
lol
cheers dude
Posted: Sat Mar 05, 2005 6:40 pm
by smpdawg
Are you POSTing data from a PHP script or HTML? Post the form portion of it here I can take a look at it.
Posted: Sun Mar 06, 2005 11:29 am
by 2bran
Yes i am using a html a html form to pass the information to PHP script.
here is the form.
Code: Select all
<form action="Addpart.php" method="POST" name="PartSearch">
<table width="132%" border="1" class="left">
<tr>
<td width="127">Add Part </td>
</tr>
<tr>
<td>Part No. </td>
<td width="183"><input name="PartNo" type="text" class="field"></td>
</tr>
<tr>
<td>Manufacturers code </td>
<td><input name="Mancode " type="text"></td>
</tr>
<tr>
<td>Suppliers Code</td>
<td><input name="Suppcode" type="text"></td>
</tr>
<tr>
<td>Description</td>
<td><textarea name="Descrip" cols="60"></textarea></td>
</tr>
<tr>
<td>Bin No.</td>
<td><input name="BinNo" type="text"
></td>
</tr>
<tr>
<td>Depot Stock </td>
<td><input name="Depot" type="text"></td>
</tr>
<tr>
<td>Total Stock </td>
<td><input name="Total" type="text"></td>
</tr>
<tr>
<td>Cost Price + V.A.T </td>
<td><input name="Cprice" type="text" value="£"></td>
</tr>
<tr>
<td>Retail Price + V.A.T </td>
<td><input name="Rprice" type="text" value="£"></td>
</tr>
<tr>
<td>.
<input name="Search" type="submit" value="Add part"></td>
</tr>
</table>
<table width="200" border="1" class="H1">
<tr>
<td>Create Part
<a href="Modifypart.htm">
<input name="Createpart" type="submit" class="buttons" id="Modify Stock" value="Modify Stock">
</a></td>
</tr>
</table>
</form>
within the form is a table not too sure if that causes any complications?
william
Posted: Sun Mar 06, 2005 12:01 pm
by smpdawg
The form looks normal. Please post the structure of the parts table.
Posted: Sun Mar 06, 2005 12:58 pm
by 2bran
here is the structure
Code: Select all
Field Type Null Default
PartNo int(255) No 0
Mancode text No
Suppcode text No
Descrip text No
BinNo int(255) No 0
Depot int(255) No 0
Total int(255) No 0
Cprice int(255) No 0
Rprce int(255) No 0
didn't know how to display it so i pasted it in sorry
william
P.S cheers for all ur help by the way its musch appreciated.
feyd | 