No errors coming up!!!!

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

2bran
Forum Commoner
Posts: 38
Joined: Fri Mar 04, 2005 7:03 pm

Post 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.
User avatar
smpdawg
Forum Contributor
Posts: 292
Joined: Thu Jan 27, 2005 3:10 pm
Location: Houston, TX
Contact:

Post by smpdawg »

Does your code actually say this? I am specifically asking about the space after the $.

Code: Select all

$ Connection= mysql_connect("", "", "");
2bran
Forum Commoner
Posts: 38
Joined: Fri Mar 04, 2005 7:03 pm

here is another script example

Post 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))
&#123;
    echo "<table border=1 cellspacing=0><tr><td>Title</td></tr>"';
    echo "<tr>";
    echo "<td>" . $row&#1111;'CustomerID'] . "</td>";
    echo "</tr>"
    echo "</table>"
&#125;

echo '<a href="Job details.htm">To enter job details click here</a>';
 	
	
	?>
if you can see anything wrong please let me know.

william
User avatar
smpdawg
Forum Contributor
Posts: 292
Joined: Thu Jan 27, 2005 3:10 pm
Location: Houston, TX
Contact:

Post 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
Forum Commoner
Posts: 38
Joined: Fri Mar 04, 2005 7:03 pm

2bran

Post 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
User avatar
smpdawg
Forum Contributor
Posts: 292
Joined: Thu Jan 27, 2005 3:10 pm
Location: Houston, TX
Contact:

Post 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.
2bran
Forum Commoner
Posts: 38
Joined: Fri Mar 04, 2005 7:03 pm

Post 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
User avatar
smpdawg
Forum Contributor
Posts: 292
Joined: Thu Jan 27, 2005 3:10 pm
Location: Houston, TX
Contact:

Post by smpdawg »

The form looks normal. Please post the structure of the parts table.
2bran
Forum Commoner
Posts: 38
Joined: Fri Mar 04, 2005 7:03 pm

Post 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
:oops:

william

P.S cheers for all ur help by the way its musch appreciated.

feyd | :)
Post Reply