PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, January 31, 2022

[FIXED] How to set OUT parameter in PROCEDURE

 January 31, 2022     phpmyadmin     No comments   

Issue

I use phpMyAdmin version 4.1.14.8 and MySQL version 5.5

I have a procedure that does exactly what I want. I created it with the procedure popup-dialog in phpMyAdmin.

Now when I call it I just want to know if he created the entry or not.

Procedure is something like this:

INSERT INTO
`entries`
(`user_id`, `creationDate`, `description`)
SELECT
`user`.`id`, CURRENT_TIMESTAMP, description
FROM
`user`
WHERE
`user`.`session_id` != ''
AND
`user`.`session_id` = session_id

Now I wanted to set the newly created id as an OUT parameter with LAST_INSERT_ID() but I am unsure how to do this because whenever is use a semicolon to finish the first statement and just adding e.g.

SELECT
*
FROM
`entries`;

phpMyAdmin throws an error saying I should read the manual on how to do the whole part after the first semicolon =(


Solution

my problem here was that I assumed that phpMyAdmin would already add BEGIN and END to the procedure...



Answered By - cherry-wave
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing