Hello,
May be try something like this:
$query1=
CREATE TABLE contacts(
id int(16) NOT NULL auto_increment,
phone varchar(15) NOT NULL,
name varchar(15) NOT NULL,
address varchar(15) NOT NULL,
PRIMARY KEY (id)
);
$query2 = INSERT INTO contacts VALUES ('NULL','$phone', '$name',
'$address');
Rij wrote:
I input the values from a HTML form. Here is the partial code.
$phone = $_POST['phone'];
$name = $_POST['name'];
$address = $_POST['address'];
$query = INSERT INTO contacts VALUES ('$phone', '$name', '$address');
if (mysql_query($query, $con))
Ok, figured it out.
I was using an int for the field but the value was too large for it. I
used bigint instead and life is suddenly so much better. Well it helps
that its bright and sunny here too :)
On Sun, Apr 19, 2009 at 10:37 AM, mrfroasty mrfroa...@gmail.com wrote:
Try using var_export() or
mrfroasty wrote:
Hello,
May be try something like this:
$query1=
CREATE TABLE contacts(
id int(16) NOT NULL auto_increment,
phone varchar(15) NOT NULL,
name varchar(15) NOT NULL,
address varchar(15) NOT NULL,
PRIMARY KEY (id)
);
$query2 = INSERT INTO contacts VALUES ('NULL','$phone',
WHERE columname LIKE condition
^^^ example.
On Friday 10 September 2004 10:22 am, Stuart Felenstein wrote:
Okay, I was under the impression that where is
implied inthe joins xx.xx = xx.xx . Is that not the
case ?
As a matter of fact, there isn't even a where or like
in my query.
I think everyone knows that $sql is a statement. But what people are
asking is: what is that statement?! Because if there are incorrect
characters or 's in that statement, then that can break your
code/statement.
~Philip
On Sep 9, 2004, at 5:49 PM, Stuart Felenstein wrote:
Just getting back to
As I said this is a code generator (dbqwiksite). So,
describing the process for creating the code is
different. The $sql is fine, as far as typos or
incorrect characterrs. I've gone through those
statement very carefully.
I've also tried to run a debug with no luck.
But I do know that there is
did you make the change to the code I suggested? What does MySQL say the error
is?
-Micah
On Friday 10 September 2004 07:49 am, Stuart Felenstein wrote:
As I said this is a code generator (dbqwiksite). So,
describing the process for creating the code is
different. The $sql is fine, as
I had not, my apologies. I think your post slipped
by. Anyway, yes I have now inserted mysql_error() and
got my return. Though I'm not entirely sure how to
fix it.
Here is the error.
You have an error in your SQL syntax. Check the manual
that corresponds to your MySQL server version for the
Okay, I was under the impression that where is
implied inthe joins xx.xx = xx.xx . Is that not the
case ?
As a matter of fact, there isn't even a where or like
in my query. Then again myabe that's why I can see
*all* records but not run a search.
Can you please provide an exmample of the
Forgot to CC the list..
---BeginMessage---
there is a WHERE on the last line of the statement you sent me.
Where's are in the form of:
WHERE value condition value
Yours is in the form:
WHERE condition value
You're not providing anything to compare the latter value to. You can imply
I think maybe there is an implied where in the
generated code, but not in my statement. I'm saying
when I chose ACCFIN (as in the referred error
message), the join should be looking at the referred
table , value ACCFIN . e.g. Code_Table.CodeID
(ACCFIN) = MAIN_Table.CodeID (ACCFIN) return label.
I understand your intent, but that is not really what is happening. The code
changes I suggested did two things:
1) Echo's the error statement that mysql produces
2) Echo's the actual SQL statement that is sent to the DB
you should be looking at #2 for answers, not your intended query. This
Now that I'm not getting an invalid error message any
longer, how can I get it to echo the sql statement ?
Stuart
--- Micah Stevens [EMAIL PROTECTED] wrote:
I understand your intent, but that is not really
what is happening. The code
changes I suggested did two things:
1) Echo's the
echo $sql. .$sql_ext;
Read the docs:
http://www.php.net/echo
http://www.php.net/mysql_query
On Friday 10 September 2004 01:18 pm, you wrote:
Now that I'm not getting an invalid error message any
longer, how can I get it to echo the sql statement ?
Stuart
--- Micah Stevens [EMAIL
Just getting back to this thing. There are 3 files
involved, search.php, connections.php and
functions.php.
I searched through all and couldn't find the meaning
of the $sql_ext. $sql is just the sql statement I
inserted into the code.
Great that I can't get a response from the company.
If
What are the variables $sql and $sql_ext set to? The query format is
fine. It's probably in your variables.
--
Peter Ellis - [EMAIL PROTECTED]
Web Design and Development Consultant
naturalaxis | http://www.naturalaxis.com/
On Wed, 2004-09-08 at 12:29 -0700, Stuart Felenstein wrote:
I'm using
HI
try
$result = mysql_query($sql . . $sql_ext . limit 0,1)
or die(Invalid query.mysql_error());
which will give more detail on the error.
HTH
Peter
-Original Message-
From: Stuart Felenstein [mailto:[EMAIL PROTECTED]
Sent: 08 September 2004 20:29
To: [EMAIL PROTECTED]
Not sure what the varialbe are set too. Going through
the code and rebuilding the query.
Post on hold to further notice :).
Stuart
--- Peter Ellis [EMAIL PROTECTED] wrote:
What are the variables $sql and $sql_ext set to?
The query format is
fine. It's probably in your variables.
--
Change the code to this:
$result = mysql_query($sql . . $sql_ext . limit 0,1) or
die(mysql_error().br.$sql. .$sql_ext . limit 0,1br);
And you'll get the error from mysql and a copy of the actual query. Without
that, it's pretty tough to help.
-Micah
On Wednesday 08 September 2004
What exactly is in the $sql and $sql_ext??
Try to put it into a variable so you can print out what you're sending
to the DB
Such as:
$query = $sql . . $sql_ext . limit 0,1;
Echo $query . BR;
If your $sql and $sql_ext combine to make a valid sql query, the is
just putting a space inside the
What's contained in $sql and $sql_ext ???
Stuart Felenstein wrote:
I'm using a product called dbqwiksite pro. PHP
generator for PHP - MySQL
The code seems to be working fine except in my search
page where I receive an invalid query
$result = mysql_query($sql . . $sql_ext . limit
0,1)
or
You need to realize that phpMyAdmin is a database manangement tool, not a database. So
I'll answer your questions based on the mySQL database ...
1. MySQL 3.23.43b introduced a table type of InnoDB which is the first to allow
foreign key constraints. http://www.mysql.com/doc/en/SEC448.html
table.
PrimaryTable(X,Y,category,Z) pk:X
SecondaryTable(category)pk:category
I am not intending to enforce referential integrity. My question is just
about the interfacing.
Thank you,
Phani.
From: Ryan Jameson (USA) [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Please help - Managing
:
Subject: RE: [PHP-DB] Please help -
Managing relational tables using PHP
01/02/03 04:34 PM
You're not evaluating the variable correctly...
Instead of...
$site = .row['site'].;
It should be...
$site = $row[site];
Or
$site = $row['site']
I'm not sure why you have leading and trailing
periods, either. Looks like you were trying to
do string appends, but they're not
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
you can do this...
$myvar = ecplode(' ', $postcode);
$firsthalf = $myvar[0];
But not everyone puts the space in there
S
On Thursday 04 April 2002 5:29 pm, Dave Carrera wrote:
Hi All
I have a variable returned by my application.
For
$post = ereg_replace((.*) ,\\1, $old_post);
If you want to search mysql for this that is something else
-Original Message-
From: Dave Carrera [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 10:29 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Please help count ?
Hi All
I
Dave,
Try:
$postcode_parts = explode( , $postcode);
The first part of the postcode will be available in $postcode_parts[0].
- Chris
-Original Message-
From: Dave Carrera [SMTP:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 5:29 PM
To: [EMAIL PROTECTED]
Subject:
Can I ask why you're not using autoincrement for your
id field? If you used this you would never have the problem
your having.
Everytime a record is added it will increment the id field
by one, so you don't have to use all the code your using.
Howard
-Original Message-
From: Leif
...
Let us know how you get on!
=dn
- Original Message -
From: Beau Lebens [EMAIL PROTECTED]
To: 'Inter-Media Webmaster' [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: 14 March 2002 00:21
Subject: RE: [PHP-DB] PLEASE HELP !!!
try an IP
// -Original Message-
// From: Inter-Media
On Thursday 10 January 2002 21:28, HiM wrote:
I am sorry that last message haven't give the URL...:(
http://nori.dns2go.com:8080/phpnuke/html/admin.php
http://nori.dns2go.com:8080/phpgroupware/setup/config.php
I was trying to use to phpnuke system and also the phpgroupware.
I have
Jason,
But after downgrade to 4.0.6, is there any new feature I can't use?
Nori Chan
- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 10, 2002 9:41 PM
Subject: Re: [PHP-DB] Please help, On phpnuke and phpgroupware.
On Thursday
On Thursday 10 January 2002 21:53, HiM wrote:
Jason,
But after downgrade to 4.0.6, is there any new feature I can't use?
Nori Chan
If you're going to be using only PHPNuke and/or PHPGroupware and they haven't
been updated for 4.1.1 then they won't be using any of the new features of
, January 10, 2002 10:07 PM
Subject: Re: [PHP-DB] Please help, On phpnuke and phpgroupware.
On Thursday 10 January 2002 21:53, HiM wrote:
Jason,
But after downgrade to 4.0.6, is there any new feature I can't use?
Nori Chan
If you're going to be using only PHPNuke and/or PHPGroupware
On Thursday 10 January 2002 22:15, HiM wrote:
Jason,
phpNuke problem fixed after downgrade to 4.0.6
Glad to hear.
Thanks !
You're welcome :)
--
Jason Wong - Gremlins Associates - www.gremlins.com.hk
/*
Falling in love is a lot like dying. You never get to do it enough to
become
In the printf() line after 5 6 7 you try to print %s 24 times but only provide 10
values. That may have something to do with it...
Bogdan
Jeff Moncrieff wrote:
Hello
I am trying make a script fatch my data form my mysql database. I use
this script but when execute it is says
Warning:
Try using fsockopen() function :
$file = fsockopen (www.yahoo.com, 80, $err_num,
$err_msg, 30);
You can find more informations about this fuction in
http://www.php.net/manual/en/function.fsockopen.php
May it help you.
Andy
www.mediahostnet.com
--- G [EMAIL PROTECTED] wrote: Hello! i
would
use that counter variable. check if its equal to 2 before incrementing, if
it is then BR and reset to zero, otherwise just increment.
if ($counter==2) {
echo BR;
$counter=0;
} else {
$counter++;
}
marios
- Original Message - Original Message -
From: Matt C [EMAIL
I realize this is trivial... but if you're using things like the code
below alot it can clean things up a bit by using:
if (($counter % 2) == 0 ($counter != 0))
echo BR;
$counter++;
echo img src=whatever...\n;
Just reads easier... less branching, less code. In an ideal world it'd
you do not need a counter, just use a 2 column table
| Thats my code!
|
| What I want to be able to do is have it so instead of one column there are
| two columns of pictures:
|
|
| pic1 | pic2
| pic3 | pic4
|
| etc..
|
|
| How can I do this?
|
| Thanks in advance!
|
It might help us to see exactly what the query is...
Could you insert an echo statement and let us know what SQL query it's
producing?
echo
INSERT INTO News
(NewsDate,NewsTitle,NewsText)
VALUES
('$NowDate','$NewsTitle','$NewsText')
;
-Original Message-
From: AKA Hook
Here is the echo output.
UPDATE News SET NewsTitle = 'Text',
NewsText = 'can\'t use quotes!' WHERE NewsID = 16
Matthew Loff [EMAIL PROTECTED] wrote in message
000e01c10d89$6fa576c0$0100a8c0@bang">news:000e01c10d89$6fa576c0$0100a8c0@bang...
It might help us to see exactly what the query is...
PROTECTED]]
Sent: Sunday, July 15, 2001 3:56 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] PLEASE HELP! Problem with ODBC string insert
Here is the echo output.
UPDATE News SET NewsTitle = 'Text',
NewsText = 'can\'t use quotes!' WHERE NewsID = 16
Matthew Loff [EMAIL PROTECTED] wrote in message
e values in double quotes? I
know that's valid with MySQL...
I don't have any other suggestions... Does anyone else?
-Original Message-
From: AKA Hook [mailto:[EMAIL PROTECTED]]
Sent: Sunday, July 15, 2001 3:56 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] PLEASE HELP! Problem w
SELECTing. It's ugly, but it would work...
-Original Message-
From: AKA Hook [mailto:[EMAIL PROTECTED]]
Sent: Sunday, July 15, 2001 7:21 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] PLEASE HELP! Problem with ODBC string insert
I tried double quotes and many different combinations of single
when you say an error - do you mean any error?
or specific errors? ie., you're not getting it stuck in an infinite loop?
(cpu time flips up to that when you stick in a loop)
or is it all errors?
PHPFAN [EMAIL PROTECTED] wrote in message
9eetk0$92d$[EMAIL PROTECTED]">news:9eetk0$92d$[EMAIL
-Original Message-
From: Slider [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 02, 2001 9:27 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Please help me with this script...
Hello,
I've been working on this script all day, but I'm getting the
same failure
report each time:
48 matches
Mail list logo