Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. GuardianOfTheFlame

    [Enum Implementation] can I loop through class constants?

    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...
  2. GuardianOfTheFlame

    [Enum Implementation] can I loop through class constants?

    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'...
  3. GuardianOfTheFlame

    can a trigger know info about the process raises it?

    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...
  4. GuardianOfTheFlame

    Import XML to MySQL

    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) ;-)
  5. GuardianOfTheFlame

    can a trigger know info about the process raises it?

    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)...
  6. GuardianOfTheFlame

    Mysql error

    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...
  7. GuardianOfTheFlame

    Mysql error

    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...
  8. GuardianOfTheFlame

    Mysql error

    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) ;-)
  9. GuardianOfTheFlame

    Automatic Empty to Null Conversion

    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...
  10. GuardianOfTheFlame

    limit number of parameters in a stored procedure

    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...
  11. GuardianOfTheFlame

    limit number of parameters in a stored procedure

    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...
  12. GuardianOfTheFlame

    Graphical reports

    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...
  13. GuardianOfTheFlame

    limit number of parameters in a stored procedure

    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...
  14. GuardianOfTheFlame

    limit number of parameters in a stored procedure

    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...
  15. GuardianOfTheFlame

    Cursor for a prepared SELECT

    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...
  16. GuardianOfTheFlame

    MySQL stored procedure output parameters

    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...
  17. GuardianOfTheFlame

    MySQL stored procedure output parameters

    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...
  18. GuardianOfTheFlame

    MySQL stored procedure output parameters

    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 -...
  19. GuardianOfTheFlame

    MySQL stored procedure output parameters

    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...
  20. GuardianOfTheFlame

    MySQL stored procedure output parameters

    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...

Part and Inventory Search

Back
Top