> mysql_query ("INSERT INTO users (First,Last,Phone,Mobile,Email,Web) VALUES
> ('$first_name','$last','$phone,'$mobile','$email','$web') ");
>
> echo('$username','$last')

This doesn't work. You need to make a variable for the executed query, like,

$query = mysql_query(.....);

After that, you get $query. But this is not the data you want. You can
`echo` $query if you want to. What you get there is called resource
id.

So, you need to extract the data using mysql_fetch_something.

Look up mysql_fetch_array or mysql_fetch_assoc for that infomation.
You might wanna recheck mysql_query to know what you are really doing.




On 10/7/07, sm <[EMAIL PROTECTED]> wrote:
> I have been racking my brains trying to figure out what I am doing wrong. i
> have created a basic form that calls requests user information...the form
> then runs insert.php.  No errors are returned, however, my database does not
> update.  Any suggestions? thanks
>
> The field names in the table are correct (case).
>
>
> SUBMIT.HTML:
>
> <form action="insert.php" method="post">
> First Name: <input type="text" name="first"><br>
> Last Name: <input type="text" name="last"><br>
> Phone: <input type="text" name="phone"><br>
> Mobile: <input type="text" name="mobile"><br>
> E-mail: <input type="text" name="email"><br>
> Web: <input type="text" name="web"><br>
>
> <input type="Submit" value="click para enviar">
>
> </form>
>
>
> INSERT.PHP
>
> <? php
> echo"hello"
> $username = "guest";
> $psswd = "password";
> $db = "contacts";
> $host = "localhost";
>
> $first_name = $_POST['first'];
> $last = $_POST['last'];
> $phone = $_POST['phone'];
> $mobile = $_POST['mobile'];
> $email = $_POST['email'];
> $web = $_POST['web'];
>
> mysql_connect($host,$username,$psswd) or die ("errror in access db");
> mysql_select_db($db);
>
>
>
>
> mysql_query ("INSERT INTO users (First,Last,Phone,Mobile,Email,Web) VALUES
> ('$first_name','$last','$phone,'$mobile','$email','$web') ");
>
> echo('$username','$last')
>
> echo mysql_error(mysql_connect($host,$username,$psswd));
>
> ?>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to