| | |
how to diplay this ineserted data?
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2008
Posts: 11
Reputation:
Solved Threads: 0
actually, i'm a newbie in php...i'd like to ask you guys.....how to display back all the data from the database for these coding....here's the coding....
i wantto display these two element....thanks in advance.....
php Syntax (Toggle Plain Text)
($_POST ['action'] == 'pointofcontact'){ $projectid = $_POST['projectid']; $poc = ''; //echo "Pastikan pilihan anda betul!!<br><br>"; for ($i=1; $i <= 3; $i++){ $poc = 'poc' . $i; $poc2 = $_POST[$poc]; if (!empty($poc2)){ $query = "insert into projectcontact set resourcesid = '$poc2', projectid = '$projectid'"; $result = mysql_query($query); $projectid = $_POST['projectid']; } //echo $poc2."<br>"; } if ($result){ header ('Location: createproject.php?action=projectmanager&projectid='. $projectid); } and number 2 is this :- else if ($_POST ['action'] == 'uploaddownload'){ $projectid = $_POST['projectid']; $docname = $_POST['docname']; $remarks = $_POST ['remarks']; $query = "insert into user_upload set docname= '$docname' , remarks = '$remarks' '"; $result = mysql_query ($query); if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 20000)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; // $_FILES["file"]["error"] - the error code resulting from the file upload } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; // $_FILES["file"]["name"] - the name of the uploaded file echo "Type: " . $_FILES["file"]["type"] . "<br />"; // $_FILES["file"]["type"] - the type of the uploaded file echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";//$_FILES["file"]["size"] - the size in bytes of the uploaded file echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";// $_FILES["file"]["tmp_name"] - the name of the temporary copy of the file stored on the server if (file_exists("upload/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]); echo "Stored in: " . "upload/" . $_FILES["file"]["name"]; } } } else { echo "Invalid file"; } }
i wantto display these two element....thanks in advance.....
Last edited by peter_budo; Aug 9th, 2008 at 7:18 am. Reason: Keep It Organized - please use [code] tags
Hi Asyieen,
I'm afraid the reason why nobody has answered so far is that it's not very clear what you actually want.
You posted a script that inserts records into projectcontact and user_upload.
And you say you want to display "these two elements". Word "element" is usually used for referencing a tag in a HTML document, while with databases we speak about tables, their records / rows and their attributes.
So what do you need? To list all records in a database table? Have a look at documentation for mysql_fetch_assoc() there's an example that does just that.
I'm afraid the reason why nobody has answered so far is that it's not very clear what you actually want.
You posted a script that inserts records into projectcontact and user_upload.
And you say you want to display "these two elements". Word "element" is usually used for referencing a tag in a HTML document, while with databases we speak about tables, their records / rows and their attributes.
So what do you need? To list all records in a database table? Have a look at documentation for mysql_fetch_assoc() there's an example that does just that.
Petr 'PePa' Pavel
The more information you give the more relevant answer you get.
Please consider using "Add to ... Reputation" and mark your thread as Solved if you found what you were looking for. By giving feedback you help others.
The more information you give the more relevant answer you get.
Please consider using "Add to ... Reputation" and mark your thread as Solved if you found what you were looking for. By giving feedback you help others.
![]() |
Other Threads in the PHP Forum
- Previous Thread: get_url or fopen challenges
- Next Thread: Modifying
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail mediawiki menu mlm mod_rewrite multiple mysql number oop parse paypal pdf php phpincludeissue phpmyadmin problem query radio random recursion regex remote script search server sessions sms soap source space speed sql structure subdomain syntax system table tag tutorial update upload url validation validator variable vbulletin video web white xml youtube





