Jump to content

Zane

Administrators
  • Posts

    4,362
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Zane

  1. <?php $check = 1; echo <<<JSCRIIPT function checkB4SaveForm() { var checkacct={$check}; if (checkacct==1) { var show = confirm("This account exists! Would you like to view it?"); if (show) { searchAndDeleteForm(); return false; // show the record and cancel save transaction } else { return false;"; // cancel save transaction } } } // end function JSCRIPT; ?> Try this out, for the sake of syntax and good reabability
  2. You haven't provided any code whatsoever for us to use to point out the error.
  3. What do you mean it doesn't work?
  4. SELECT substring(invW.StockCode, 1, (len(invW.StockCode) - 1)) as sStockCode , SUM(invW.QtyOnHand - invW.QtyAllocated) AS 'Value' FROM SysproCompanyJ.dbo.InvWarehouse as invW WHERE invW.QtyOnHand > '0' And Warehouse = 'SW' GROUP BY substring(invW.StockCode, 1, (len(invW.StockCode) - 1)) HAVING SUM(invW.QtyOnHand - invW.QtyAllocated) > 0 Untested.
  5. True.. I guess I'm used to the mysql errors rather than mysqli, mysql would throw a non-boolean error.
  6. You get this notice because $row is not defined.. By this I mean, it is ONLY defined in your IF statement and no where else, put $row=null; above your if statement and your notice will be gone. The 'm' would throw an SQL error, not a PHP Notice.
  7. Read up on Nested Sets, that seems to be what you're after. I must sleep now. http://www.evanpetersen.com/item/nested-sets.html http://www.slideshare.net/billkarwin/models-for-hierarchical-data
  8. You should never store aggregate/calculated data in a table like that, it's an absolute waste of space and energy. Imagine your elder sent you to the store to get groceries and handed you 100 dollars. Also imagine that you must go to multiple stores to pick everything up, plus you may need gas money, and you might even want a bottle water too. Would you continue to calculate what you have spent after every transaction? Would you seriously want to continue adding the totals of the receipts and writing down the sum every time? When you go to pay the cashier(s), are you planning to pull all of those receipts out of your pocket, add them up and see whether or not it is greater than 100? Or, would you simply count what money you have left in your pocket? The quickest possible way would be the latter. Storing your total_replies would be known as storing duplicate and redundant data. Every time a reply is made, you will have to run one extra unnecessary query to update total_replies. Furthermore, you logic for the post_id to reply_to does not make sense. According to your data, Post ID 1 is a reply to Post ID 1 and that cannot be. That would be like saying you are your own parent; that your mother and father are literally yourself. In order to do what you are describing would require an endless amount of self joins, if I'm not mistaken. Ideally, the post_id should be a primary key that auto increments. Your next column would be the thread id. and you could query like so SELECT p.post_id from posts p inner join threads t on t.thread_id = p.thread_id where p.thread_id = XWhere X would be, of course, the thread id. This would give you a table of posts inside thread X. And since your post_id is auto incremented, you can assume that the lowest post_id returned from the above query is the first post in that thread. So you could safely add an ORDER BY p.post_id to receive a list of posts for thread X in ascending or descending order.
  9. What, may I ask, is holding you back from switching hosts, other than financial reasons? You are a member of a community where very detailed solutions to virtually any technical problem(s) can be found; given, of course, that you supply a just as detailed question? Shared hosting is meant to be very affordable, and you definitely get what you pay for. You can't buy a Geo and expect it to run like a Ferrari. I have used GoDaddy as a registrar ever since I can remember buying my first domain name, way back in the 90s. I have also used OpenSRS and PipeDNS, but in the end I find that GoDaddy supplies me with the best user interface for my domain administration needs and that is why they are so revered. When you see a commercial of theirs, hardly ever will you hear them hawking hosting plans. Even though they could easily paint a picture of a hosting plan and its prices onto Danica Patrick and still make sales, they aren't. Domains are their forte, it's plastered all over their pages just as Danica was erotically painted on camera. For around 200 bucks an account with justhost, or bluehost or anyotherhost.com can be purchased; and that's for a one year lease. For 20 bucks you can have a host up, running, and accessible for a month. They even offer free domains names, which you will not need since you're already with godaddy. Yeah, a FREE domain may seem enticing, but you would end up with a sub-par, poor quality, domain name management system. At that point you will have realized that Godaddy is a better place for your domains, and it will cost you fifty dollars or more to have that domain transferred to your Godaddy account. This is how I have experience with OpenSRS and PipeDNS, I took the bait and grabbed a FREE domain, which is only like a dollar (and some change) every month. So when you say that the income is not there yet, I don't believe you. Unless you're living off free wifi, a free laptop scored by a successful dumpster dive, potatoes and water, there's no good reason you can't afford the switch. Packup/Backup your entire site and database and copy it to your new host. It's not like switching apartments. So long as your godaddy account is not expired, all of your data will ideally be on both hosts until you let your GD account expire, or you physically delete them. Until you change the nameservers on your domain, the new host will act as a development server. When you run into technical problems, PHPF and all of the rest of the free Web Dev Help communities that exist are going to be there for you, given, of course, your construct a clear question. Yea, being a consumer has it's downsides at times as far as power and control go. Every financial institution has some sort of contract with their preferred software company making them consumers as well, passing all the savings and heartache of commercial software onto you as you struggle to understand how to transfer $2.52 to your checking account for that check floated for a double cheeseburger. I promise you, once you switch to an actual host that doesn't spend most of its earnings on models, extremely gorgeous ones at that, who can seduct you into buying yourfullname.com just in spite of your dream of seeing it on her body; as though you were living vicariously through your domain name, you will have more of a stress-free experience with your website.
  10. You need to make sure that $_GET['username'] contains exactly what you're looking for before you query the database. echo it out, alert it, whatever you feel like doing. Also, it might not hurt to add the word 'username' or 'user' or the letter u in front of the usernames... for instance RewriteRule ^u/([-a-zA-Z0-9_\.]+)$ userprofile.php?username=$1 That should match http://domain.com/u/the.rocker
  11. I use ZPanel. It's free and has pretty much everything I need without having to shell out hundreds for something like CPanel.
  12. In my eyes, Godaddy is just a registrar (a place to buy and manage domain names).. When I look for hosting I got somewhere where hosting is their main business. Whenever I see a Godaddy commercial, I see that really hot chick talking about the new deals on .COM domains, not hosting. There is a thread somewhere that has a list of good hosts. I enjoy linode, but only for large scale projects...otherwise, I usually got with justhost.com or webhostingpad.com
  13. Going back to the initial problem you mentioned in your OP. This problem can easily be solved by adding a $id = null; into your else statement. That is only one reason though why it is ruining your query. You where statement should be in a separate variable if you intend to collect all records at some point. instead of, or along with $id, you should have a variable called $where, that contains a string like this WHERE id = $id and give it a value of null when you don't need it as I explained in the beginning. So you query will look something like this instead SELECT blah.* FROM someTable $where
  14. Here is an excellent tutorial on exactly what you're looking for. http://net.tutsplus.com/tutorials/other/a-deeper-look-at-mod_rewrite-for-apache/
  15. If there was ever a correct way to necro a thread, I would have to say you nailed it CV.
  16. $array = array('one' => 'one'); $array= json_encode($array); $array= json_decode($array); All this does is create and array, encode it, and decode it. In other words, you are turning it into a sendable format, then changing it back to an array. Completely anti-productive if you ask me.
  17. if($balanceQ->fetch_assoc()['balance'] >= 0){
  18. Experiment first, ask questions later. It's like asking someone the best way to hold your breath underwater; you will never know for sure unless you get in the water yourself.
  19. foreach ($animals as $word){ if($word == "chicken") echo '' $animals[2] ''; else echo $word; }
  20. $message_parser->message = '[quote="@' . $post_data['quote_username']
  21. http://wordpress.org/plugins/wp-e-commerce-change-currency-symbols/
  22. Unlike contractors, cosmetologists, and clerical staff, and more, the web development field requires no certain certifications to land a job. There are no OSCEA rules to conform to, no health inspections, no drug tests, only experience is required. If you can prove yourself to be a capable, competent, and confident web developer, then college is unnecessary. If, however, you are aiming to earn some type of certification/degree for your own self-confidence, self-worth, etcetera,... I would recommend community college/technical college. I earned my Associate's degrees in Web Technologies and CIS and during that time I had the opportunity to dabble in several different languages (from HTML to Visual Basic, XML, XSL, PowerBASIC, VisualBasic, .NET, and more... Having taken such courses does not in any way make me anything close to an expert in those languages but I can say that I have used them before to create basic to intermediate quality applications... most basic. The question to ask yourself is "Do you want to expand what you know by being a student or a worker?" Being a student has its advantages in that you are not under the pressure of losing a job, disappointing an employer, nor are you flat out humiliating yourself by not knowing what to do. With an instructor you can ask, ask, ask, research, ask, repeat. The disadvantage is the motivation factor. Being a student, however, does not allow you to experience the world of creating something valuable from nothing. Unless you are the top student in the class, your work will mainly be just good enough to get a passing grade. Being a worker has its advantages in that you are pressed to create under a deadline. Even though homework does indeed have due dates, the homework only benefits you whereas a deadline in the work environment is vital to the success of the business; all or most or a sizeable portion of the expected output lies on your shoulders. If you enter the work environment without enough knowledge of programming, system design, planning, time budgeting, etc.. you will be pressed with the only option of staying and improving or leaving (being fired) In Short, a great portfolio is all you need.
  23. Please don't resurrect year and a half old threads, especially ones in which the question has obviously already been solved.
×
×
  • 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.