Jump to content
Larry Ullman's Book Forums

luisfalcon

Members
  • Content Count

    9
  • Joined

  • Last visited

  • Days Won

    1

luisfalcon last won the day on February 28 2015

luisfalcon had the most liked content!

Community Reputation

1 Neutral

About luisfalcon

  • Rank
    Newbie
  1. hello Mr Ullman: I am currently building an application using stripe. I ran into the following problem. I have members on the applications who sell their goods. anonymous users come and pay for those goods. I can create the charge on stripe and send the money to my users no problem. However, I want to charge my users a percentage, or a flat fee, from that transaction. ex: (This is a fictional example!! i don't have a old underwear selling site). Members of my site post and sell their old underwear using my platform. people visit the site, they like the underwear and they de
  2. SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'database_name' AND TABLE_NAME = 'table_name'; with this command you can get the auto increment value for the table that you want. so you could build your insert using a subquery like this $q3 = "INSERT INTO movie_actor (movie_no,actor_no,rate) VALUES ( SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'movie' AND TABLE_NAME = 'table_name', SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'actor' AND TABLE_NAME = 'table_na
  3. SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'database_name' AND TABLE_NAME = 'table_name'; with this command you can get the auto increment value for the table that you want. so you could build your insert using a subquery like this $q3 = "INSERT INTO movie_actor (movie_no,actor_no,rate) VALUES ( SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'movie' AND TABLE_NAME = 'table_name', SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'actor' AND TABLE_NAME = 'table_name',
  4. OK, after so much research (and a lot of trial and error). I found the solution to the problem. Here it is : Since browsers cache the pages and every time you visit a site or press the back button all you received is the cached version of the page (including the information that was submitted on a form). When you press the back button the cache version of the page will be taken ( in the case of the login the Resubmit Form page will appear and if you refresh you are back on). The solution is not letting the browser cache the page that has the submission. So to do this we just need t
  5. check this command. SELECT * FROM `information_schema`.`INNODB_SYS_INDEXES` WHERE table_id = (select table_id from `information_schema`.`INNODB_SYS_TABLES` where name = 'database_name/table_name') this will give you the name of all the indexes created for that table. named or unnamed. created by you or the system. you could use this to build another level of subquery to automatically select the right index and drop it. you could also run it like this SELECT * FROM `information_schema`.`INNODB_SYS_INDEXES` WHERE table_id = (select table_id from `information_schema`.`INNODB_SYS_TAB
  6. Hello. Your instructor is right. relationships are not needed between tables. However, you should do them since mysql is after all a Relational database management system. The foreign key relationships ensures referential integrity, which means, that you are making sure that the data in the child table is directly mapped to an existing value on the parent table. If this "referential integrity" between tables is not maintain then some garbage values can be imputed. If you do not build the relationship, you or malicious users, could enter a product id in the sales tables even if the item
  7. Hello Mr. Ullman. Yes please, I do still need help with this. I have tried different forums and methods to avoid that from hapenning. Changing headers to avoid browser chaching pages and others. but I still have the problem I you, or anyone reading the forum could help me out I would very much appreciate it. Thank you again.
  8. I confirm if i Close the browser of course I cannot access the page. There is no information in the browser back button stack to get the error and the page cannot be access without the session variables. I output the session array after i log out and it is indeed empty. I think this error is more on how the login process is done than the output. It is as if when i press the back button on the browser my login form gets re submitted and I am all of a sudden back on the site. One solution I thought about was completely separating the login process (i.e. having a page alone by itself do the
  9. Hello: I am reading this book and following on the examples. I finished the ex1 and I am testing the site. I notice that When i Log out from an account then refresh the page I go back to the index.php (which is OK). Now the problem is when i use the back button of the browser. If i go back to the log out page then back again (to the page where I logged out from) at first there will be an error, but if i refresh the page There i am logged back in with all the credentials as if i never logged out. This of course is a flaw. Imagine I am on an public place and I log out of a site and
×
×
  • Create New...