Govinda wrote:
I've got a form that loads and saves product data to mysql. In some
fields
like the heading and subhead we use special characters like Omega,
Registered Trademark, and Ampersand. When putting the data in I will
encode
them as Omega;, etc. Once saved, all is good, everything goes
I have come across this before. Make sure you put around the value field
and then single quotes around the variable, ie.
tdinput type=text value=?php echo '$tracking_num' ?
/td
tdinput type=text value=?php echo '$id' ? (NOTE: if this is an int
value, you do not need to use the single
Try putting the hidden element statement down inside the while loop in he
second page, but change it to INPUT TYPE=\hidden\ NAME=\id[]\
VALUE=\$id\ and add
$id=$row['id'];
before it.
I will show below where it should go.
HTH
MB
jas [EMAIL PROTECTED] said:
I have made the changes you
Let's see what your code looks like now and where it is returning the
word array. That might help determine where the problem lies now.
MB
jas [EMAIL PROTECTED] said:
Ok to this point I have been able to query a database table, display the
results in tables and within a form. As of yet I
You didn't add the value part of the hidden element, ie.
INPUT TYPE=\hidden\ NAME=\car_type\ value=\$myrow[car_type]\
You were naming the field as an array with no value.
if you want to pass this as an array of values, you would need to use:
INPUT TYPE=\hidden\ NAME=\car_type[]\
When you call your $car_type in the second page, you need to set a variable
starting at 0 and call it as $car_type[0] and loop through all of the values
in the array.
ie.
$i=0;
while ($car_type[$i]) {
I have added more code below that should help.
MB
jas [EMAIL PROTECTED] said:
Yeah,
One problem I see is that you are sending all of the values for all of your
fields (except the id field) from the first page to the second page, not just
the ones that are checked, so even if it was working properly, you would get
a list of all items in the table, not just the checked items.
All you need to do is assign the variable (let's call it $id) the id for that
record set from the database. Then pass this variable to the next page for
the delete.
You may want to search for the mysql_fetch_array function on php.net. This
would be used to grab the record set from the
Ok, you have almost got it. I have made little remarks further down in your
code which should just about do it for you.
jas [EMAIL PROTECTED] said:
I don't know what it is but I am having a hell of a time trying to get some
results of a query setup into an array or variable (too much of a
Is $cars an array field? If not, you are trying to compare $cars to an
list/array of values (I am not sure this would work even if $cars was an
array field) 'WHERE $cars
= $car_type\,\$car_model\,\$car_year\,\$car_price\,\$car_vin\,\$dlr
_num\);'.
Normally, you would have to compare each
According to your code, if the checkbox next to the word 'remove' is checked,
then the value of $cars passed to the form is checkbox. Then in the
done2.php3 page, you are trying to delete where checkbox='array of values
listed'.
Is there a field in your database called checkbox? If so,
Here is what your delete statement should look like:
$sql = mysql_query(DELETE FROM $table_name WHERE id = '$id',$dbh) or
die(mysql_error());
Note the field name without the $ in front of it and the variable you are
comparing it to with the $.
One other note, in your table, you have id as a
Your $sql already contains a mysql_query. Why are you running it against it
again, unless you have changed something.
If $sql only contains your delete statement(without calling mysql_query),
then do not put quotes around $sql,$dbh
Otherwise, come back with what $sql and $dbh are assigned to
Try putting single quotes around your variables in your update statement
instead of the escaped double quotes, they are easier to read.
Also, were you wanting to update all entries in that table to the same,
c_name, s_addy, city, state, zip and phone? If not, you will need to
add 'where
Is your id an integer or a char/varchar? If it is an integer, take the
quotes off $id in your select statement.
Todd Williamsen [EMAIL PROTECTED] said:
Weird..
I want to be able to edit records, which I have done in the past, and I
cannot see why it isn't working... I have tried
++;
}
?
Also, without the value in the option tag, you will not be passing anything
to the form.
HTH
Maureen Biorn
Todd Williamsen [EMAIL PROTECTED] said:
I am trying to get data from two columns, FirstName and Last name and
displaying all the records LastName, FirstName in a drop down menu
Isn't date a reserved word that should not be used as a field name? It
appeared that what was asked was if he should change the name of his field
from date to date_1. It should definitely be changed if it is now called
date.
Jason Wong [EMAIL PROTECTED] said:
On Wednesday 31 October 2001
If any of the values you are trying to insert are not integers, you need to
put single quotes around the variables, ie. $SCRIPT_NAME, $date, $BName, etc
in the insert statement.
Robby Whiteside [EMAIL PROTECTED] said:
Hi There,
I have a query whenever I try to insert something into a
You should not need the extra semicolon in there to complete the SQL
statement. All you need is the one at the end.
Vera Algoet [EMAIL PROTECTED] said:
Cecily,
I'm sure you probably heard from others about your parse error. I know
it looks weird, but you need to have two semicolons, so
Here is an excellent example at PHPBuilder (a great site for finding tutorials)
http://www.phpbuilder.com/columns/rod2221.php3
HTH
Maureen
Andrius Jakutis [EMAIL PROTECTED] said:
Hello,
I need example of making simple thing: to list only 10 entries per page, and
next 10 is shown
It appears that the error is pointing to the last line of your code (just by a
quick count of the lines). This normally means that you are missing a closing
bracket somewhere in your code.In glancing through your code, the first
while statement has an opening, but no closing bracket (unless
if that
fixes it. You may need to restart the server that PHPMyAdmin is running on to
get it to register. Let us know if it still does not work. Thanks.
Maureen Biorn
Doug Schasteen [EMAIL PROTECTED] said:
I'm running a local web server for development on my Win ME machine
using apache
look somewhere
else for the problem.
Maureen Biorn
Doug Schasteen [EMAIL PROTECTED] said:
It works great! However, even though my .sql file was only 2.4 mb, it
took nearly 15 minutes to import it all. I expect to be working with
20mb files in the not too distant future. Will it really take
Most likely, your id (index, auto-increment field, whatever it is) data type
is tinyint which only goes to 127.
Brian Grayless [EMAIL PROTECTED] said:
Is anyone familiar with this MySQL error?
1062: Duplicate entry '127' for key 1
I wrote a great bookmark management program that works
The problem is in your insert statement. You forgot the $ on your month and
year variable values.
Your statement should read:
$sql = INSERT INTO $table_name (day,daydate,month,year,time,place,numbers,
details,reportby) VALUES
25 matches
Mail list logo