Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About [Coyot3]

  • Rank
  • Birthday 02/24/1985

Contact Methods

  • Website URL
  • ICQ

Profile Information

  • Location
  1. [Coyot3]

    MySQL Triggers

    Finally I found the problem.For those who have the same problem I recommend to read Section D.1, “Restrictions on Stored Routines, Triggers, and Events” at MySQL website.Triggers and other Stored Routines are under some restrictions. In this case the problem are the lines where i perform SELECT operations because they return a result set.These operations must be done using user defined variables with SELECT ... INTO ... instruction and the final trigger will look like CREATE TRIGGER generatePin AFTER INSERT ON sbauctions_members FOR EACH ROW BEGIN SET @pin = SHA(NOW()); SET @pinLength =
  2. [Coyot3]

    MySQL Triggers

    Hi all,everytime I need to create a trigger I get in troubles.This time I have the code above CREATE TRIGGER generatePin AFTER INSERT ON sbauctions_members FOR EACH ROW BEGIN SET @pin = SHA(NOW()); SET @pinLength = 8; SET @start = FLOOR(1+RAND()*((LENGTH(@pin)-@pinLength)-1)); SET @statusName; /* get name of status where bids are forbidden and expose allowed */ SELECT @statusName:=name FROM sbauctions_status WHERE bid=1 AND expose=0; /* insert activation member status */ INSERT INTO sbauctions_members_status (memberID,statusID,pin) VALUES (LAST_INSERT_ID(),@statusName,@pin);
  3. [Coyot3]

    query prob

    Try this$Rsql = mysql_query("INSERT INTO post (name, time) VALUES ('$name',NOW())") or die (mysql_errno() .": ". mysql_error()); and tell us the message you got!
  4. Hi all,I'm trying to execute the following query from PHP SET AUTOCOMMIT=0;START TRANSACTION; INSERT INTO `viagens` (origem, destino, matricula, dataPartida, dataChegada, descricao, iva, preco) VALUES (1, 2, '123456', DATE_FORMAT('2008/02/24 10:40','%Y/%m/%d %H:%i'), DATE_FORMAT('2008/02/28 12:00','%Y/%m/%d %H:%i'), 'excelente viagem :)', 21, 16); SELECT @last:=max(idViagem) FROM viagens;INSERT INTO `viagensLocaisTuristicos` (idViagem, codigoLocal, dataPassagem) VALUES (@last,2,DATE_FORMAT('2008/02/26 15:15','%Y/%m/%d %H:%i')); INSERT INTO `viagensLocaisTuristicos` (idViagem, codigoLocal, da
  5. Start playing with sockets!
  6. [Coyot3]

    Foreign Keys

    @Reg Edit: You're right !Thanks a bunch
  7. [Coyot3]

    Foreign Keys

    @justsomeguy: thanks for your answer.Your suggestion is to create a schema like categories(id,name,description)catCat(parent,id) where parent will be foreign key from categories (like id) and both will form the primary key of catCat.You suggestion make sense if we think about transitive closure: if A is B's mother and B is C's mother then A is C's mother.Which solution you think is better?@Reg Edit: Allow nulls in mother column is only possible if the attribute is not FOREIGN KEY (neither PRIMARY).I'm not sure that this is the best solution. I'm thinking to create other table to store relat
  8. [Coyot3]

    Foreign Keys

    Hi all,think about the case you want to describe a table like: CREATE TABLE categories( id INT NOT NULL AUTO_INCREMENT, name VARCHAR(50) NOT NULL, description VARCHAR(255) NULL, mother INT NOT NULL DEFAULT 0, PRIMARY KEY (id), FOREIGN KEY (mother) REFERENCES categories(id)) ENGINE=INNODB; the goal is to get support to a leveled menu likecars BMW FORDmotos KAWASAKIThe problem I got, when trying to insert the first (and least) record, was #1452 - Cannot add or update a child row: a foreign key constraint fails (`bookmarks/categories`, CONSTRAINT `categories_ibfk_1` FOREIGN KEY (`moth
  9. [Coyot3]

    url problems

    Are you running your script on your localhost or webserver?Check if in your php.ini REGISTER GLOBALS are 'On'!Which erro message you get?
  10. in my browser (Safari) your footer is on bottom.i supose that you want a white space between your three middle bars. to do this you just have to define a footer margin like #footer {border: 1px solid #ccc;margin: 20px 0 0 0;padding: 4px;background-color: #000000;font-size: 16px; color: #FFFFFF;} if you want to put your footer in the bottom of the page set position to absolute and bottom to 0.
  11. [Coyot3]

    float left

    maybe your problem is here: h1.floatleft{float: left;padding: 5px 0px 5px 5px; width: 99%;} if your h1.floatleft has 99% of page with the object that will appear on the right of h1.floatleft only can have 1% of page width (or other object with).Reduce h1.floatleft width and i supose you will get your problem solved.enjoyPaulo A. Silva
  12. the problem is the <embed> that is not standard.
  13. take a time to read this article.
  14. I'm sorry but here i only can check with Safari and FireFox. I'm a OS X user I'm thinking about your problem i got other. your left side height is less than your content space, so you will get your text around your menu.Writting your content box on the left you can use float: left without problems.I will check a way to solve this and i will say you later. Sorry.OK, i supose that i got want you want: <!-- HTML PAGE--><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml
  15. to take out all space around the text do this: h1{ margin: 0; padding: 0;} to check if everything is OK you can set borders like this: h1{ border: 1px solid red;} now you know how are yours h1's. than set border to 0.Paulo A. Silva
  • Create New...