nav33n 472 Purple hazed! Team Colleague Featured Poster

Files

nav33n 472 Purple hazed! Team Colleague Featured Poster

Intern
net
rent

Engineer

nav33n 472 Purple hazed! Team Colleague Featured Poster

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php
echo"Your posted name is\t".$_POST;
echo"Your posted roll is\t".$_POST;
?>
<?php
$con=mysql_connect("localhost","root","");
if(!$con)
{
die("could not connect:".mysql_error($con));
}
mysql_select_db("form",$con);
mysql_query("insert into submit values('$_POST','$_POST')");
echo"1 record added";
mysql_close($con);
?>
</body>
</html>
error is showing on that line..........

The error is with the parsing of quotes. Instead, use

$name=$_POST['name'];
$roll=$_POST['roll'];
mysql_query("insert into submit (col1,col2) values ('$name','$roll')");

Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

Your Ostrich's Ugly.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Play games! Its good for health.

nav33n 472 Purple hazed! Team Colleague Featured Poster

phone
hole
pole

Comparison

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hi, Check out w3schools. for basics of php. If you want the whole package of php, apache and mysql, try wamp (for windows platform) or xampp. Just install it and lo! you will have all the 3.
All the best.

Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

Bugger, well I guess the only thing left to say is "The universe is winning" ;)

:P Maybe you should contact your administrator who provides you mysql service. Btw, is this your local computer or are you testing it on the server ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

fall
lan
fag

Mermaid

nav33n 472 Purple hazed! Team Colleague Featured Poster

-605

nav33n 472 Purple hazed! Team Colleague Featured Poster

liar

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) That's what I was talking about.

<?php
$con = mysql_connect("localhost","root","talk21");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("lastr");

if(isset($_POST['team']))
{ 
     foreach($_POST['team'] as $value) {
          $insert="INSERT INTO team (team) VALUES ('$value')";
     mysql_query($insert);
    }
}
?>

This will definitely work. :)

P.S: Next time you post your code, please post it within code-tags.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Even though the site, itself, is designed for 1024x768 resolution, the Coffee House dropdown menu slightly extends past that area.

ah! ok..

nav33n 472 Purple hazed! Team Colleague Featured Poster

huh! Well, I dunno then. :( Sorry.

nav33n 472 Purple hazed! Team Colleague Featured Poster

err! lack of creativity :P

Trap
enter
name

Whiskey

nav33n 472 Purple hazed! Team Colleague Featured Poster

Umm.. is Id an auto-increment field ? What did echo $insert print ? Could you show us the statement ? Did you execute that statement in phpmyadmin/mysql ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Okay! Take out 'team' and put team. ie.,

$insert="INSERT INTO team (team)
VALUES ('$value')";

Tellme if it works.

nav33n 472 Purple hazed! Team Colleague Featured Poster

No. You can open multiple instances of phpmyadmin's while running your script :P lol..

And, user table is in mysql database.

Server: localhost - Database: mysql - Table: user "Users and global privileges"

nav33n 472 Purple hazed! Team Colleague Featured Poster

Everything looks good. But why do I get a horizontal scroll when I scroll over Coffee house ? Also, the menu(for coffee house) is outside the visible area(the last option, Daniweb Community feedback is partially visible).
Btw, my resolution is 1024*768.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hmm.. user root has all the permissions AFAIK. But if you have access to phpmyadmin, go to my sql database and select table user. Check the permission option under File_priv. If its N, make it Y.
Hope that helps.

nav33n 472 Purple hazed! Team Colleague Featured Poster

tail

nav33n 472 Purple hazed! Team Colleague Featured Poster

-603

nav33n 472 Purple hazed! Team Colleague Featured Poster

Day and night, we work like donkeys !

nav33n 472 Purple hazed! Team Colleague Featured Poster

et
tea
at

coffee

nav33n 472 Purple hazed! Team Colleague Featured Poster

umm.. You don't have a mysql_select_db in your script. If it isn't inserting, use die function with mysql_error with your query. For eg.

$query="select * from tablename";
mysql_query($query) or die(mysql_error());

So, if there's any problem with your query, it will output the error message, which you can use to debug your query.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Ok, but that won't cause the access error would it?

Nope. If it's outside that directory, it will generate an error with errorcode 2.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Ok, it can't be grant access because I'm using administrator. I thought it might be my windows firewall preventing access but I've turned it off and I'm still getting the access denied error. Are there any other possibilities?

I've tried this on 2 separate servers not associated with one another at all and I'm getting the same access denied error.

No. I am talking about mysql user. Not the one you use to log on to windows.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Oh, btw, users.txt should be in mysql/data/dbname/ ! That's where it looks.

nav33n 472 Purple hazed! Team Colleague Featured Poster

You need to escape "\" by adding another "\". Eg.

<?php
$path="C:\\Documents and Settings\\User 123\\My Documents\\";
?>
nav33n 472 Purple hazed! Team Colleague Featured Poster
<?php
$con = mysql_connect("localhost","root","talk21");
if (!$con) {
    die('Could not connect: ' . mysql_error());
}
if(isset($_POST['team'])) {    foreach($_POST['team'] as $value) {
    $insert="INSERT INTO team ('team') VALUES ('$value')";
echo $insert;
mysql_query($insert);
}
}

Try this. It will print out the query. Execute it in phpmyadmin or mysql. I don't think your query or the table structure is wrong. Maybe the values of $_POST isn't being passed. Well, execute these queries and find out why its not inserting !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Your code works fine on my computer. You are probably getting 'access denied' because you don't have enough privileges for the mysql user. Use grant to grant permissions for the users.

nav33n 472 Purple hazed! Team Colleague Featured Poster

How do you make out whether a user is an admin, a student or a staff member ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Lol.. Welcome to Daniweb Celeareth!

nav33n 472 Purple hazed! Team Colleague Featured Poster

in ur retrieve.php it should be

and not $_REQUEST

$_REQUEST can handle both $_POST and $_GET. (And also $_COOKIES).

nav33n 472 Purple hazed! Team Colleague Featured Poster

Your query isn't returning any rows. Check your conditions, try one condition at a time, check where you are going wrong.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Did you execute your query in phpmyadmin/mysql ? Is it just not printing any values or is it giving any error ? Can you show us your query ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

rent
rely
net

Ostrich

nav33n 472 Purple hazed! Team Colleague Featured Poster

Two people got drowned in rain water today !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Persians Like Eating Apples, Strawberries, Eggs.

nav33n 472 Purple hazed! Team Colleague Featured Poster

-600

nav33n 472 Purple hazed! Team Colleague Featured Poster

maid

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb Vinod :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb Richie!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

bail

nav33n 472 Purple hazed! Team Colleague Featured Poster

tap
put
part

Alternative

nav33n 472 Purple hazed! Team Colleague Featured Poster

Understand the concepts of life and you will lead a happy one!