Hi,
I've been trying to write a set of scripts that modifies data in a database. Two of the colums in a certain table are number and name. I want to write a script that will give the number of a row when the name is inputted. However with teh following script, the output is always 'Resource id #3' whether the name exists or not.
<?php
if($form == NULL) { ?>
<form action="modify.php" method="POST">
Short Name: <input type="text" name="name"><br>
<input type="hidden" name="form" value="named">
<input type="submit" name="submit" value="Submit me!">
<?php } ?>
<?php
if($form == "named") {
mysql_connect('localhost', 'root', '');
mysql_select_db('micropc');
$number = mysql_query("SELECT number
FROM components
WHERE 1 AND name = '$name'
LIMIT 0 , 30"); ?>
Any ideas as to what I'm doing wrong?
Thanks,
Seft