How to insert POST data [closed] - php

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I do not know how to insert POST data to mongodb collection. I try to do it like this:
$collection ->insert($_POST);
But in this case I get An Internal Server Error. What is the best and most concise way to do it?

Better way to make an array of all post data and pass it to insert like
<?php
$post = array("username" =>$_POST['username'], "password" => $_POST['password']);
$collection->insert($post);
?>

Related

How can I get table data for my tables in my website? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 days ago.
Improve this question
How can I get table data for my tables in my website?
I want to update my table data every minute. Is there any extension for it?
And Could you give me a example for better understanding?
I don't know anything about extract data. So, I didn't try anything.

Determine source of code that is making a query [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
Exist any way to know the source page that is calling the query and store it?
Are you looking for $_SERVER['PHP_SELF'] ?
Check also print_r($_SERVER) if something is more accurate for what you need

Pass a URL as a get parameter in php [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
http://example.com/geturl.php?url=http://example.org/index.php?parafile=1698%3A1562%3A0%3A0&para_action=print_ticket&parafile=dance://here.kodas/print&token=3ec2b0d3e6e0ca152bc024cc3f30f16c
So i want each of this parameters in a different varaible in the geturl.php file. I am using the regular get url
You can use anything like this :
$url = "http://example.com/geturl.php?url=".urlencode($urlPart);
$_server[QUERY_STRING] solved my problem

Recreating a dynamic php array [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a php array which is created from data in an sql database.
All I want to do is recreate that identical array on another site.
I can print_r it no worries. But how would I output the structure of the array so that I can go as follows on the new site.
$newvar = array(.....);
I'm sure it's a very simply question, But I can't find an answer.
serialize Try this function. I think this is what you need
you can use json_encode to send your array and keep the structure of your array.

Calling a field from database in MySQL [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
return(array($clientName,$salesPer,$prospectVal,$projID));
The projectID is dynamically added in database for each entry, now how can i return the ID. As i have not set any variable in PHP to map the database field.
Can anyone guide me on this.
If you're asking how to get back the ProjectID after it has been inserted into the database and automatically assigned, I suggest using something like the following:
$projID = mysql_insert_id();
immediately after running the insert statement.

Categories