logo-dw

Go Back   Dreamweaver Club Forums > Dreamweaver forums > Video Tutorials
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 05-14-2009, 08:08 PM   #1
MaravillaEnt
 
Join Date: Apr 2009
Posts: 7
Default php code error in browser

PHP Code:
<?php
require_once("Connections/connection.php"); // database connection
 
///////////////////////////////////////////////////////////
$data2 $_POST['data2'];
$data3 $_POST['data3'];
$data3 $_POST['data4'];
$submit $_POST['submit'];
///////////////////////////////////////////////////////////
 
if ($submit && $data2 && data3 && $data4){
 
///////////////////////////////////////////////////////////
$query sprintf("INSERT into table1 (field2, field3, field4) values ('$data2', '$data3', '$data4')");
mysql_query[$query]or die[mysql_error()];
///////////////////////////////////////////////////////////
 
}elseif($submit){
 
echo 
"One of your fields is empty !";
 
}
im getting parse error on line 15.
everything looks right to me .. but hey.. im no expert just yet.

Last edited by davidj; 05-14-2009 at 10:04 PM..
MaravillaEnt is offline   Reply With Quote
Old 05-14-2009, 10:04 PM   #2
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

Quote:
mysql_query[$query]or die[mysql_error()];
this should be

Quote:
mysql_query($query)or die(mysql_error());
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 05-15-2009, 01:27 AM   #3
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,164
Default

i get my reading glasses from Seymour Clearly. its an easy mistake to make
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 05-15-2009, 08:17 AM   #4
Corrosive
Corrosive's Avatar
 
Join Date: Feb 2008
Location: Bristol, England
Posts: 7,103
Default

Quote:
Originally Posted by edbr View Post
i get my reading glasses from Seymour Clearly. its an easy mistake to make
You are on fine form today Mr B. Something in the 'Barley' water?
Corrosive is offline   Reply With Quote
Old 05-15-2009, 08:27 AM   #5
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,164
Default

actually a very good villa opening last night might have something to do with it, no water involved though
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:53 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com