Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 22nd, 2007, 07:03 AM
Authorized User
 
Join Date: Nov 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mark jonas
Default mysql/php inserting into a table

morning/afternoon all


ok have a problem at the mo i have a form that get passed to a script and the information is up dated in the database table now i have three problems.

First:

i have a form text box so you can write more information ie a description which passes to the script now this is the code im using to update

if (isset($_POST['desc'])){

     $value_desc = trim($_POST['desc']);

     if (!empty($value_desc)){

     $query_desc = "UPDATE hotels SET description = '$value_desc' WHERE name = '$id'";

     mysql_query($query_desc) or die(mysql_error());

     }
}

and then nothing happens as if its not there

secound:

when inserting a new recored into the database table using this code i get the same problem

$query = "INSERT INTO hotels(name, address1, address2, town, county, postcode, tel, fax, extra1, extra2, email,www, pageViews, wwwClick, imageAlt, description) VALUES ('$name', '$address1', '$address2', '$town', '$county', '$postcode', '$tel', '$fax', '$extra1', '$extra2', '$email', '$www', '$pageViews', '$wwwClick', '$imageAlt', '$desc')";

MYSQL_QUERY($query) or die(mysql_error());


and last but not least whats the best coloum type in a database to use to store numbers ie like 89.0.0.0.0.0

thanks for your time hope this make sensis

cheers
mark

 
Old February 25th, 2007, 05:54 AM
Authorized User
 
Join Date: Feb 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

In the form tag when you are submitting the form values are you using "POST" method or "GET" method.

Try to echo the values which you are passing from form
like

echo "$_POST['desc']";





Similar Threads
Thread Thread Starter Forum Replies Last Post
inserting BLOB into MySQL DB, carriage newline jcsnyder PHP Databases 1 September 8th, 2006 12:51 PM
begin php & mysql - chapter 12, user_form.php jon_stubber Beginning PHP 1 March 9th, 2006 10:57 AM
dynamic inserting into mysql using C code qassem MySQL 0 March 28th, 2005 08:34 AM
Problem inserting blob data/uploading file - MySQL kyle_shea Beginning PHP 2 February 15th, 2005 10:18 AM
copying from table 1 inserting in table 2 gilgalbiblewheel Java GUI 0 September 15th, 2004 03:40 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.