| | |
can't post a reply message in .php
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2007
Posts: 40
Reputation:
Solved Threads: 0
i used phpmyadmin software then i create a database named sycom_dbase, but the problem i can execute it. but there is no output? and error messages.. any comments suggestions. why did it happens. where should i save all my php files.. www? i save it in www folder but it didn't still connect to the database i guess. any connectors needed? please help thnks..
(im NEWBIE here)
Here's my sample code
(im NEWBIE here)
Here's my sample code
PHP Syntax (Toggle Plain Text)
<?php $sName = $_POST['engrSName']; $sAdd = $_POST['engrAdd']; $sPCode = $_POST['engrPCode']; $sLline = $_POST['engrLline']; $sMob = $_POST['engrMno']; $sAge = $_POST['engrAge']; $sBday = $_POST['engrYear']; $sUname = $_POST['engrUName']; $sPword = $_POST['engrPName']; $sEmail = $_POST['engrEmail']; mysql_connect("localhost","admin","charmander") or die('Error: ' . mysql_error()); mysql_select_db("sycom_dbase") or die('Error: ' . mysql_error()); mysql_query("INSERT INTO sycom_accountuser (sycom_Name, sycom_Address, sycom_PostalCode, sycom_Landline, sycom_Mobile, sycom_Age, sycom_Birthday, sycom_Username, sycom_Password, sycom_Email) VALUES(".$sName.",".$sAdd.",".$sPCode.",".$sLline.",".$sMob.",".$sAge.",".$sBday.",".$sUname.",".$sPword.",".$sEmail.")"); echo "Database Updated..."; ?>
Sorry mate, you're not making much sense. What exactly is the problem. What errors do you get? Have you tried accessing the DB with a very simple query?
"...the woods would be a very silent place if no birds sang except for the best"
All opinions count - unless you're a serial downvoter.
F'enw i yw Mr. Blaidd. Byddwch yn ofalus - dwi'n cnoi.
All opinions count - unless you're a serial downvoter.
F'enw i yw Mr. Blaidd. Byddwch yn ofalus - dwi'n cnoi.
You can put your files anywhere in your local server as long they have acces to the connection string:
As a rule, you'd create a connection include file:
/includes/db.inc.php
You'd place this code into the file and then include this file in all your db-using "normal php files". A simple way to do this would be:
e.g. for files in your document root:
then carry on creating your querystring and query the database.
PHP Syntax (Toggle Plain Text)
mysql_connect("localhost","admin","charmander") or die('Error: ' . mysql_error()); mysql_select_db("sycom_dbase") or die('Error: ' . mysql_error());
As a rule, you'd create a connection include file:
/includes/db.inc.php
You'd place this code into the file and then include this file in all your db-using "normal php files". A simple way to do this would be:
e.g. for files in your document root:
PHP Syntax (Toggle Plain Text)
include("includes/db.inc.php");
then carry on creating your querystring and query the database.
"...the woods would be a very silent place if no birds sang except for the best"
All opinions count - unless you're a serial downvoter.
F'enw i yw Mr. Blaidd. Byddwch yn ofalus - dwi'n cnoi.
All opinions count - unless you're a serial downvoter.
F'enw i yw Mr. Blaidd. Byddwch yn ofalus - dwi'n cnoi.
Can you get a php file to show in your browser at all? Without any MySQL I mean. Just something easy like:
PHP Syntax (Toggle Plain Text)
echo "Hello World!";
Last edited by ardav; Feb 2nd, 2009 at 8:18 pm.
"...the woods would be a very silent place if no birds sang except for the best"
All opinions count - unless you're a serial downvoter.
F'enw i yw Mr. Blaidd. Byddwch yn ofalus - dwi'n cnoi.
All opinions count - unless you're a serial downvoter.
F'enw i yw Mr. Blaidd. Byddwch yn ofalus - dwi'n cnoi.
![]() |
Similar Threads
- PHP Form Validation ??? (PHP)
- PHP Sendmail Tutorial (PHP)
- PHP e-mail SMTP error ??? (PHP)
- PHP E-mail setting ??? (PHP)
- Error Message: Cannot find server; page cannot be displayed (Viruses, Spyware and other Nasties)
- Php newsletter error (PHP)
- Hello Help I'm Wired PhP (PHP)
- error message when shutting down, startup page stuck to http://dr-search4u.com/ind... (Viruses, Spyware and other Nasties)
Other Threads in the PHP Forum
- Previous Thread: PHP Captcha Problem -- Please help me
- Next Thread: problems with php include
| Thread Tools | Search this Thread |
.htaccess alerts apache api archive array autocomplete beginner binary broken cakephp checkbox class cms code convert cron curl database dataentry date display duplicates dynamic echo email emptydisplayvalue error errors execute explodefunction file files firstoptioninphpdroplist folder form forms function functions google hack href htaccess html htmlspecialchars image include insert ip javascript joomla keywords limit link login loop mail menu methods mlm multiple mysql network object oop paypal pdf php problem query radio random recursion recursive redirect remote script search securephp server sessions shot sms source space sql subscription syntax system table tutorial tutorials update upload url validator variable video web youtube





