thank you, it works great! ;)
this is the final version of my enum implementation:
//Report Type enum implementation
final class ReportType {
const Total = 'total';
const SpecificCenter = 'specific_center';
const AllCenters = 'all_centers';
const Average = 'average';
// ensures...
hi all,
my question is (regarding the ReportType class):
is there a way to loop through the costants defined in the class?
this is my enum implementation:
final class ReportType {
const Total = 'total';
const SpecificCenter = 'specific_center';
const AllCenters = 'all_centers'...
I don't want to know the source of the INSERT statement that logs the values: this should be not a problem cause I know that I'm in the trigger.
What I want to know is the source of the INSERT statement that raise the trigger
this is the scenario:
- my application send the following command to...
you can load an XML file into a table using LOAD XML statement:
http://dev.mysql.com/doc/refman/5.5/en/load-xml.html
---
The surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us - Calvin (and Hobbes) ;-)
Hi all,
in my database, I have:
- a table "Visit"
- a stored procedure "sp_create_visit"
- a table "logs"
CREATE TABLE `logs` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`operation_type` int(2) NOT NULL DEFAULT '1' COMMENT '1=no changes; 2=insert, 3=update, 4=delete',
`users_id` int(11)...
if you don't use mysqli, you can run only one statement at a time.
In your code, the string $title contains 2 statements (DROP and CREATE); you should separate them:
//drop "title" table if exists
$drop_title = "DROP TABLE IF EXISTS title;"
$results = mysql_query($drop_title)
or die...
oh right: you cannot run multiquery statements using mysql_query. To do that, you must use mysqli:
http://php.net/manual/en/mysqli.multi-query.php
however, the CREATE TABLE statements have an extra ")" and raise errors if you run them directly in MySQL
---
The surest sign that intelligent...
it's simple: there's one extra ")" in your $title string ;)
---
The surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us - Calvin (and Hobbes) ;-)
I also think it should be done by your application
However, you can force the NULL values using before triggers.
Here is an example:
DELIMITER $$
CREATE TRIGGER t_insert_before_table BEFORE INSERT ON table
FOR EACH ROW BEGIN
IF NEW.Textfield = '' THEN
NEW.Textfield=NULL...
mmm... maybe I've done the wrong example; however the columns are not similar: they have different meanings and types (number, varchar, text, enum)
Every visit can track different values so the columns for the first visit aren't the same of the column in the second visit.
Now I have data for...
it's our database design, but I describe it in a quick way; it's more complicated.
Now we used the system to generate clynical studies so every questionnaire is a visit.
There are several doctors that logon to the study's site and each doctor has more patients to visit. Every row is the patient...
we use open flash chart in our sites:
http://teethgrinder.co.uk/open-flash-chart/
now there is a new version:
http://teethgrinder.co.uk/open-flash-chart-2/
---
The surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us - Calvin (and...
the engine receives an XML in input that contains the definition of a study formed by more questionnaires.
The engine is used to publish a site (in php) and to create the database in which store the answers.
There are several XSL trasformations that create php files and SQL scripts (to create...
Hi all,
is there a limit to the number of parameters in a stored procedure?
I have an engine that generate a "CREATE PROCEDURE" script that receives in input a list of columns.
I cannot find a way to pass an array parameter in MySQL, so the XSLT must create a parameter for each column:
CREATE...
Hi all,
how can I create a cursor for a SELECT statement previously prepared?
I must do something like this:
DECLARE cur CURSOR
FOR SELECT * FROM <tab> WHERE Id=<id>;
<tab> and <id> are parameters passed to my stored procedure.
Can I prepare the SELECT statement and then assign it to the cursor...
it's ok the test using MySQL, but executing the statements in PHP code, this SQL query return no result:
I'm a newbie in this, is it possible that this code:
$sql = "call sp_logon('$User',md5('$Pwd'), @Logged, @AsActideUser)";
$mysqli = new mysqli($this->host, $this->user, $this->pwd...
ok this is my stored procedure:
DELIMITER $$
DROP PROCEDURE IF EXISTS `actide`.`sp_logon`$$
CREATE PROCEDURE `actide`.`sp_logon`(IN UserName VARCHAR(255), IN Pwd VARCHAR(255), OUT Logged TINYINT(1), OUT AsActideUser TINYINT(1))
COMMENT 'log the user'
BEGIN
DECLARE user_id INT(11);
SET...
yes, it's show me the projects created by the specified user.
The first print_r shows me the resultset, while the second print_r isn't executed 'cause
return no result.
---
The surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us -...
I didn't thougth to select the session variable :-|
In this way I have to execute 2 queries, but if it works then it's ok...
so I try this:
but the second query return no result. is it a problem of session?
Thanks to all!
Salo
---
The surest sign that intelligent life exists elsewhere in the...
executing a query containing my call, I have the result of the SELECT statement of users, but I also want the informations stored in the output parameters (@ErrorNumber, @ErrorMessage) that are not in the select result.
For example using .NET, you have a parameter's collection and the recordset...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.