Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About SLSCoder

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I told you once, I've been writing database apps using web technology for about 25 years. About 20 years ago I gave up on identifying foreign keys in the database because apps kept crashing on me. You suggested that I try it again. Well, the app I'm working on is probably about 50K lines & 80 tables. To do that would be some work BUT - my app allows users to create tables and dependent (slave) tables for them. There could be up to 20 user defined tables. Coding for orphans and missing IDs was becoming a problem. Because of your suggestion, the thought immediately occurred
  2. OK Thanks. We work and work and till wee hours and forget about what else is going in in the world. So, I forgot to say: Merry Christmas to you and yours. I hope you and your family have a wonderful holiday..
  3. Thanks. I think I'll give it a try. It'll be interesting to see what my current orphan status is. I'm guessing real low or even non-existent. I'm pretty careful about it. Real easy to find out; just try to create the foreign key Yea my database is normalized. Some of my IDs are replicated in more than one table but that's just to avoid deeply nested joins, which definitely slows things down. I've got about 80 tables in the one I'm working on now. Some foreign keys are 3 or more tiers. It'll take some work. OK, I'll try it. It may be awhile but I'll let you know what I conclud
  4. I think you've got me convinced about AUTO_INCREMENT. It's just that bigint makes a slower/bigger DB than int makes a slower/bigger DB than smallint. I'm thinking if I can keep the ID lower I can use a smaller number which means a smaller, faster database. Yea, I get orphans. I just clean them out programmatically. Like in a deleteCompany function I'll add a DELETE FROM people WHERE CompanyID NOT IN (SELECT RecordID FROM company) after I delete the company. You're suggesting an auto-cascading delete by using foreign keys? I'm thinking. My way is slower I suppose but I never get into
  5. Thank you. I use relationships all the time and I'm aware of deleting records that are foreign keys in other tables. Where I'm deleting the records all that is easily handled. I don't set foreign keys up in the database. I've done it for many years, all the way back to dbase. I tried setting up foreign keys once, cascading delete, etc. What a mess. I never have any problem with relationships now. My primary key is always RecordID and foreign key is <tablename>ID. RecordID, not ID because I ran into trouble years back programming C#.NET. Microsoft uses ID and it kept confl
  6. Are you just busting my chops now? Nope, I don't see it in this thread anywhere. I created the query in Navicat. It did occur to me that maybe there really is no such thing as a 'saved query' in mysql, like a stored procedure. Maybe Navicat is just storing the sql in a file somewhere? That would explain why you guys are so confused. I'm not asking about sql. Clearly, I know the sql for it and I do know how to truncate a table (which I do not want). I guess if that's the case then I just need to change the 'query' to a stored procedure.
  7. Guys, I think you *completely* misunderstood me. All I asked for was how you call an existing mysql query, needing no parameters, using mysqli. Does it really matter that much why I need it? My users delete records (that are irrelevant once they delete them), and sometimes in high quantities. I do want those records deleted and I want to reset the AUTO_INCREMENT. If I set it to 1 mysql sets the AUTO_INCREMENT to the lowest one possible. If records still exist (and they usually will) it won't end up being one. It'll be the ID of the last record not deleted. That's what I want. If I
  8. Thanks but I don't want to delete all the records in a table. What I asked was, how do I call a saved query that does not require parameters using mysqli?
  9. I usually get really great answers here. Today you guys just aren't going to are you? I've been doing this 25 years now. Noob Schnoob. I want to reset it when I delete records. I want to delete the records. Ya know, phpforum.com is pretty much useless. You guys were my only hope.
  10. Can you give me an answer please? I need to run it when records get deleted. Why does that matter to you?
  11. I created a query (not stored procedure) in mysql. It does not require any parameters. How do I call with a mysqli object? The query name is setQBAutoIncrement The code is: ALTER TABLE question_banks AUTO_INCREMENT = 1; ALTER TABLE qb_sequences AUTO_INCREMENT = 1; ALTER TABLE qb_sequences_rl AUTO_INCREMENT = 1; ALTER TABLE qb_questions AUTO_INCREMENT = 1; ALTER TABLE questions AUTO_INCREMENT = 1; ALTER TABLE q_cx_columns AUTO_INCREMENT = 1; ALTER TABLE q_cx_rows AUTO_INCREMENT = 1; ALTER TABLE q_predefined_answers AUTO_INCREMENT = 1; ALTER TABLE q_tdt_rows AUTO_INCREMENT = 1
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.