-
Posts
2,134 -
Joined
-
Last visited
-
Days Won
42
Posts posted by benanamen
-
-
How can you say that when you have no knowledge of the application?
The OP said enough right here
I just want to check to see if there are any values at all in the query.
In that case, @Jaques1 and I are correct.
-
He doesn't have a list. Somebody lied to him
-
What @Jaques1 showed you is the way to do it. You are wanting to know if there are results returned or not, true or false. How many are returned if any is irrelevant.
-
It doesn't matter. The code has been completely removed from Php. Don't use it. At the least, you should be using Mysqli
-
You cannot just through an i on the end of the deprecated functions. Take some time and read the manual. You should be using PDO anyways. https://phpdelusions.net/pdo
-
You need to create a unique constraint on whatever identifies the users. They should not be allowed to sign up more than once with the same parameters.
-
I ran across the following example of a Factory Pattern. My question is, why would you have all this Factory code when you could just call one of the extended button classes that you need?
<?php abstract class Button { protected $_html; public function getHtml() { return $this->_html; } } class ImageButton extends Button { protected $_html = "..."; //This should be whatever HTML you want for your image-based button } class InputButton extends Button { protected $_html = "..."; //This should be whatever HTML you want for your normal button (<input type="button"... />); } class FlashButton extends Button { protected $_html = "..."; //This should be whatever HTML you want for your flash-based button } class ButtonFactory { public static function createButton($type) { $baseClass = 'Button'; $targetClass = ucfirst($type).$baseClass; if (class_exists($targetClass) && is_subclass_of($targetClass, $baseClass)) { return new $targetClass; } else { throw new Exception("The button type '$type' is not recognized."); } } } $buttons = array('image','input','flash'); foreach($buttons as $b) { echo ButtonFactory::createButton($b)->getHtml(); }
-
The database has a proper design with catID in subcat table etc.
The fact that you have more than one table says you're wrong, but you know better right?
-
How can i achive this two things
You can start with a proper database design. There is no such thing as sub categories. They are ALL categories. Some are Parents, some are Children.
Look this over. http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/
-
You could have spent the last 4.5 hours working on your site instead of trying to decide where to put the files.
The Bike Shed Problem
http://it.toolbox.com/blogs/coneblog/about-project-management-the-bikeshed-problem-32923
-
Suddenly? I have never asked for homework help and I don't violate any of the other rules. What are you trying to say?
-
From the Forums Rules
Users will not post their homework questions expecting to get their homework coded for them. If you have a question about part of the assignment that you do not understand, please post asking for an explanation rather than the code.
-
Post the relevant code. We are not going to download an unknown zip file.
-
This thread reminds me of the people who spend days trying to figure out how to fill gaps in numeric IDs and end up with hideously complex, bug-ridden locking gymnastics – so that they can have a “beautiful” sequence which nobody cares about.
LOL! While I never did anything about it, in my early days missing numbers really bothered me.
Notion, in a good way.
An intervention is the process by which an addict's family, friends, counselors or professional intervention specialists can show the addict his destructive behaviors in a way that may result in the addict choosing to seek help immediately.
We here need to gather to save you from yourself.
- 1
-
@NotionCommotion, I think it's time for an intervention.
-
I don't have time at the moment to get into the implementation. I am sure Barand will jump in before I can. As far as MyISAM, what is stopping you from using InnoDB?
-
Without the exact detail on the public_id I cannot make any comments on that part.
they also share some common properties and as such a supertype/subtype solution is appropriate.
You are on the right track here. Is this the part you do not understand how to do? On a side note, MongoDB is very well suited to this type of data.
-
Isn't this when you would use a destructor in the class?
-
Why are you creating multiple tables? You should have ONE animals table linked to an animal_type_id in a animal type table. What is with the multiple keys?
-
Your code is obsolete and vulnerable to exploits and has been completely removed from Php. You need to use PDO with prepared statements.
-
Your approach is wrong in the first place. You never ever put variables in the query. You need to use prepared statements and PDO.
Also, if you have 42 columns in a single table it is highly likely your DB design is wrong. A DB is not a spreadsheet. Look up and learn Database normalization.
-
Is that the best you can do? What basics? What Month? What number? What Array?
-
-
This is going to be a reeeelly long thread. OP, the problem is you don't know what you don't know. You know enough about using a saw to cut your fingers off and that makes you dangerous in the coding world. You are not going to have any luck trying to argue what you think you know with people that actually do know what they are talking about.
With a tool like this I can have them add, edit, and manage connections and queries for multiple web server paths without the need to go into code.
If you just needed to get the job done, you could have saved the company and yourself even more time and money if you just used the free Mysql Workbench or Phpmyadmin. Aside from that, there are numerous other tools that do the same thing, free and paid. You are trying to re-invent the wheel instead of getting the job done.
If you really want to be a programer, listen carefully to what we tell you and apply it and get used to harsh criticism. There is a whole lot you don't know.
OOP - DSN
in PHP Coding Help
Posted
I am stuck on the following DI code with the DSN. Relevant lines 62, 77, 78.
I expect line 77 to work since the output of line 62 is exactly what works in line 78. I get
Fatal error: Uncaught PDOException: could not find driver in C:\Program Files (x86)\Ampps\www\dependencyinjection\DatabaseConnection.php on line 77.
If I use line 78 instead, it works.
Anyone know what the problem is?
$connection var_dump