-
Posts
5,960 -
Joined
-
Last visited
-
Days Won
146
Everything posted by gizmola
-
Well multiple comments: 1. Don't need a semi colon in your sql statement. The mysql functions already know how to submit a statement. 2. Round about way to get this. Much better to do Select count(*) as countof FROM table. This will *always* return a valid result set. You're only interested of course if there's more than one row, so simply check the return value for > 0. 3. Your problem is that to specify a literal in mysql, you use double quotes not single quotes. Several different ways to do that, but easy one is escape the double quotes, since you're trying to interpolate in your variables. $sql = "SELECT * FROM `sites` WHERE `site`=\"$site\""; Not as readable as using concatenation for most people. $sql = 'SELECT * FROM `sites` WHERE `site`= "' . $site . '"';
-
Link won't center when using variable to store
gizmola replied to ndjustin20's topic in PHP Coding Help
You need to learn about the difference between Block and inline elements. An anchor is an inline element. Hopefully this will help: http://www.webdesignfromscratch.com/css-block-and-inline.cfm Also the center tag is deprecated, meaning that you should be using css and not center. -
What exactly happens now that there's +100 rows? Did you try putting in some debug comments for some of the key variables, and question your assumptions?
-
The tnsnames.ora file is like DNS for oracle instances. Basically what that error is telling you is that it can't convert the oracle instance name you're providing to a Server/IP/Port combination. The sqlnet.ora file allows you to configure sql*net which is oracle's network protocol. Needless to say, these are 2 totally seperate things. With that said, you probably want to try and use the oracle connection string that allows you to circumvent the need for a tnsnames.ora file. There's a nice summary blog post here: http://alisonatoracle.blogspot.com/2006/02/oracle-database-connection-strings-in.html
-
Major problems with oracle please help
gizmola replied to zeezack's topic in Other RDBMS and SQL dialects
It was your use of '?'. -
The point here is that your code is referencing Array Indexes in associative arrays. In other words, you have places where you are trying to reference a value in an array, say $_POST['name'], when in fact there is no array member that exists for the index 'name'. PHP is weakly typed, and part of the advantage of using it is that you don't have to worry about these types of details as it's not an error, or a problem, depending on what your script is doing. You are seeing these messages because your php.ini file has this Error level set on. Notices are informational, and on a production server you should have them off anyways, or at least logged into a file. This setting really exists for debugging, and for those who insist on not having any unhandled code, but it's safe enough to turn down your settings.
-
Stebbi, Please read the forum rules. This forum exists to provide help to those who are trying to learn PHP.
-
Errror message seems pretty descriptive -- you don't seem to have a valid mysql connection when you're trying to execute the query.
-
[SOLVED] Returning results that equal the least times
gizmola replied to soycharliente's topic in MySQL Help
Agree with Fenway -- in some fashion determine your lowest, so this is basically the first ordered result of the group by, then you can find all of them by adding HAVING (COUNT(*) = number you want to match. You'll get a result set of only the loc's with the same count. -
rahmerab: Paste your real actual code here please. Everyone is guessing, because you're not providing the information we need.
-
Chances are, the problem is that you are passing a resource by value, although your method of testing this is poor. For example, you're looking to discern something about how PHP oop works, based on the return value of a query that could fail. With that said, you might try this: public function LoadAccess($userid, &$mysqli)
-
I think you are missing the opportunity being presented to you here. Your company is telling you they want you to use Sharepoint. Sharepoint is Microsoft's collaboration platform, that integrates with microsoft office, and is aimed at companies that want to have what used to be called "an Intranet". You should spend some time doing some research on it, and use this opportunity to get educated on how to develop with it. Of course, you can go ahead and stick PHP on the server and start hacking on PHP scripts, but they've already told you what they wanted, and it wasn't a PHP application. My advice: Start reading here: http://office.microsoft.com/en-us/sharepointserver/HA101732171033.aspx I think you'll find that Sharepoint offers a CMS, Webdav compliant document mangement system, wiki etc. Of course there are alternatives in the PHP world, however in an environment where microsoft office apps are being heavily used, Sharepoint has an advantage in that it was built to integrate with them.
-
Partial search not working as expected
gizmola replied to hadoob024's topic in Other RDBMS and SQL dialects
Not one but two tables that should be many to many resolvers, and you wonder why you're struggling? I hope you realize that even if you get these queries working, Oracle can not use indexes at all with the approach that has been taken in storing this data. With that said, the INSTR or REGEXP_LIKE functions might be of interest to you. -
Did you consider session fixation? What's important is what you're doing in memberLogin.php. This topic is discussed in many places, including an article that they've linked to on the php.net page for sessions, and there's also this article that's php specific by Chris Shifflet. http://shiflett.org/articles/session-fixation
-
To be completely honest, that site looks a bit dodgy, and so does the competition.
-
Are you really sure you want to wed your business to paypal? I personally avoid it like the plague. There's almost nothing good about it from my point of view, either as a user or as a vendor, other than it offers shorter turn around for transfer of funds. For example, I am part of a coop that owns a server. Each year we pay one of the members money to cover our colocation costs for the year, and he pays the ISP. I went to transfer some money from my checking account, and of course that's going to take 2 business days to fund. Whoopeee. Then to make matters worse, because the guy has a merchant account of some sort, now he indicates that I'll be charged a fee for sending the money via paypal this year. Sweet. I'm really thinking of whipping out a check and a stamp this year instead, which is lame, but that's how paypal rolls apparently.
-
I really like PHP, but there are issues with the PHP market. For enterprise development, it's really a 2 horse race: .NET vs. Java. There are a lot of great things about .NET, and in particular .NET with C# that can make you a very productive developer. With that said, .NET pretty much weds you to the microsoft world. There's nothing wrong with that, but it's something you need to be at peace with going into it.
-
Congrats on the interview -- step 1, but geez, maybe you should land the job before planning out the next 5 years of your life. I do wish you luck.
-
Did you read the forum guidelines? The guidelines specifically state that you won't get help in modifying 3rd party scripts. Here you are asking for help modifying 2 different script packages, neither of which you seem to understand. > This is probably why you are not getting any help -- nobody wants to wade through all that.
-
Foreign keys -- sure no problem. If you design it right, then updates to a brand would have no effect, because your normalized design would also use numeric keys to link product and brand together. In that way, changing for example, the name of a brand would not effect any products that were related to that brand, because the "brandname" column is in the brand table. Now, when you state that in deleting a brand you want to delete all related products, that is known as a cascading delete. Depending on the database, that can be set up automatically, or may require a trigger. In MySQL you can set up a cascading delete, assuming a few things, one of which was mentioned by priti: Assuming you're using MySQL: -You need to be using MySQL 5 -You need to have created your tables using the Innodb engine. -Your table declaration needs to include the ON DELETE CASCADE clause which would have been something like this in your definition of the product table: FOREIGN KEY (brand_id) REFERENCES brand(brand_id) ON DELETE CASCADE If you set this up properly, deleting a brand will delete all products of that brand. While cascading deletes are convenient for some things, they also represent a significant danger as a user could unknowingly wipe a lot of rows out of a database with one careless delete. Often you want to control this programatically. Caveat Emptor.
-
An exchange server is an MTA just like any other MTA -- it will accept mail via SMTP. Keep in mind that the exchange server may need to be configured to allow the machine you're running your php script on, to relay mail through it, depending on how it's been setup, and what your network topography is.
-
No, there's no way to do that because the pdf's are being rendered by the user's local computer. This raises the age old question of: can you show people information without having them see it? When you think on the conundrum, I"m sure you'll realize that this isn't possible --- you can't give someone a snack and not allow them to eat it, or for that matter to save a piece for their friend. You can, using certain libraries, generate pdf's on the fly that you password protect. This adds an extra barrier to the pdf and makes it that much harder for someone to distribute to the masses. If you *really* want to do this, there's a way, but what you're asking for is pretty much copy protection, and every form of copy protection ever invented to date has been broken.
-
Bit of advice on best way to find available days
gizmola replied to dc_jt's topic in PHP Coding Help
I have a lot of questions about what you're asking for, not to mention the structure of your database. For example, you imply you used a DATETIME column when you really only need a DATE column. This adds complexity, but basically, you can do a simple query like: SELECT thedate FROM holidays WHERE thedate >= CURDATE() AND thedate If that result set returns any rows, read it into an array. From there you'll have to figure out the format of the array, so that you match your php dates. As you loop through, you'll attempt to find the date in your array, and if you match, then don't render your button. One question that comes to mind is -- do you need 5 buttons regardless if the week has a holiday, or do you only show 4 in that case? Your code may need to be altered from a for loop to a repeat unil in that case. -
pdkv2 has the answer - your row has 2 columns because mysql_fetch_array creates both a numeric array of the columns of the row and an associative array. Since your query returns 1 column, when you try and do a count() on it, you get the answer of 2. I personally use mysql_fetch_assoc() which is a wrapper around mysql_fetch_array() that only returns the associative array version of the row. Really if you look at the php.net manual page for either function it has an example of how you should loop through the result set fetching rows until the set is empty, as this is fairly typical code. After your first fetch, you'd be able to do this: echo "Item num: $items['itemnum']";
-
Your list is missing one of the biggest players right now: Symfony. http://www.symfony-project.org/