PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sat Aug 18, 2018 4:15 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Aug 08, 2018 9:14 pm 
Offline
Forum Contributor
User avatar

Joined: Sun Feb 08, 2009 10:52 pm
Posts: 134
This is driving me nuts, can't see the problem here.

Here is my table definition

Attachment:
Screenshot_15.jpg
Screenshot_15.jpg [ 38.42 KiB | Viewed 123 times ]


SQL

Syntax: [ Download ] [ Hide ]
INSERT INTO custwelc_section (owner, sheader, scontent) VALUES (5, 'about me', 'vvvvvvvvvvvvvvvvv');


error in phpPgAdmin

SQL error:

ERROR: syntax error at or near "INTO"
LINE 1: SELECT COUNT(*) AS total FROM (INSERT INTO custwelc_section ...
^

In statement:
SELECT COUNT(*) AS total FROM (INSERT INTO custwelc_section (owner, sheader, scontent) VALUES (5, 'about me', 'vvvvvvvvvvvvvvvvv')) AS sub


Top
 Profile  
 
PostPosted: Wed Aug 08, 2018 10:24 pm 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13573
Location: New York, NY, US
I don't think you can use an INSERT as a sub-select. Maybe try:

GET DIAGNOSTICS integer_var = ROW_COUNT;

_________________
(#10850)


Top
 Profile  
 
PostPosted: Wed Aug 08, 2018 10:43 pm 
Offline
Forum Contributor
User avatar

Joined: Sun Feb 08, 2009 10:52 pm
Posts: 134
I didn't use it as a subselect, that's just how is is displayed in the error. All I entered was the insert statement as shown.


Top
 Profile  
 
PostPosted: Wed Aug 08, 2018 10:55 pm 
Offline
Forum Contributor
User avatar

Joined: Sun Feb 08, 2009 10:52 pm
Posts: 134
It's working now, and the only thing I did was try it in pgadmin :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group