Jump to content

gizmola

Administrators
  • Posts

    5,945
  • Joined

  • Last visited

  • Days Won

    145

Everything posted by gizmola

  1. Again, we need the structure of your table including datatypes. Do a describe tablename and paste it in here in a code block.
  2. Are you using output buffering? What webserver and version are you using? How large is 34Box.mp3 in bytes? Did you check to see if the Content-Length value being sent in the header actually matches the file?
  3. Honestly, people can't advise you about whether or not your database structure is correct, if we don't know what questions the database will need to answer. With what little info you've provided nankoweap has the right structure as far as I can tell, since it seems that what you are interested in is only the status data, which I assume from what I know about twitter is simply the last tweet that a person has made. So a couple things --> first you know that php has various xml parsing routines, and this looks to me like a job for simplexml which should make reading the data you need trivial. Secondly, this seems like it probably is a read intensive application. You can go a long way performance wise, in helping preserve your mysql performance, by using memcache to cache your entries. This way, when you parse, you really don't touch your mysql db unless there is an updated status required. You can read up on php's memcache on the php.net page for the extension.
  4. We don't have any idea what your database looks like, but the first piece of information we don't have, is what determines these order dates? Seems to me, that your algorithm as describes simply schedules someone for consecutive slots starting from Day X. We don't have any other information about the criteria to determine what the starting day should be, but it seems that getting the "last date in the database" is an erroneous approach. Why would it not be the first day > CURDATE() that does not already have 16 reservations? That's really what you're asking for aren't you?
  5. why are you declaring the column to be an int(255)? If it's an int, the largest variable that can be stored is an integer. The 255 is for display purposes. I know this has nothing to do with your question, but it bothers me when people do those types of declarations. It's not a varchar(). To your question -- I have to make some assumptions because your question is really unclear. What I assumed is that you have another column in this message table that is of type TEXT. If that is the case, then theoretically you could write an insert trigger that uses the CHAR_LENGTH() function on the TEXT column to get the size in characters of the message. This is character set aware, so it will truly be characters and not Bytes! If I read you correctly, your solution would be to write the insert trigger. Yes, I'm sure the question is -- how do I write a trigger? Check this out --- should help you. One thing about mysql triggers -- the mysql root user needs to add them typically. mysql> describe mes; +-------------+---------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+---------+------+-----+---------+-------+ | message | text | YES | | NULL | | | messagesize | int(11) | YES | | NULL | | +-------------+---------+------+-----+---------+-------+ 2 rows in set (0.00 sec) mysql> delete from mes; Query OK, 1 row affected (0.00 sec) mysql> DELIMITER | mysql> mysql> CREATE TRIGGER message_Insert_Trg BEFORE INSERT ON mes -> FOR EACH ROW BEGIN -> SET NEW.messagesize = CHAR_LENGTH(NEW.message); -> END; -> | DELIMITER ;Query OK, 0 rows affected (0.05 sec) mysql> mysql> DELIMITER ; mysql> insert into mes (message) values ('This is a string of a particular size'); Query OK, 1 row affected (0.01 sec) mysql> insert into mes (message) values ('Another string, but this one is a different size for sure'); Query OK, 1 row affected (0.00 sec) mysql> select * from mes; +-----------------------------------------------------------+-------------+ | message | messagesize | +-----------------------------------------------------------+-------------+ | This is a string of a particular size | 37 | | Another string, but this one is a different size for sure | 57 | +-----------------------------------------------------------+-------------+ 2 rows in set (0.00 sec)
  6. I'm not sure what to suggest. Seems like this calls for a joomla module to be written. The Module should include a form at the top that executes the custom search for users. The approach outlined of having a that has the terms and definitions seems fine to me. Assuming mysql, you could utilize it's fulltext index feature. You can get an idea of what is possible by looking at this site http://www.movie-gurus.com/ When you do a search in the box, it utilizes a mysql fulltext index. Put in a phrase like sky world and you'll get a whole range of titles that match either of the words in the phrase. The behavior can be controlled in a variety of ways. For something that involves words and definitions, using a fulltext index could be an excellent solution, and willl perform well, even if you end up with a large number of definitions.
  7. Stickam, BitGravity, Ustream, etc. Check them all out.
  8. Q695-- Umm, do you even understand the problem articulated? Exactly how would redirecting to another site keep the user logged in across domains? Right......
  9. If that server actually resolved so we could see the code, there might be some progress, but alas, it doesn't.
  10. FTP paths can be chrooted as well. Is that the *real* path on the server? phpinfo() is a good tool for checking these things if you don't have access to a shell, but of course the shell is ideal.
  11. Look Boxerman, You've managed somehow to get 100+ posts to this forum apparently without being even remotely aware of the rules of the board. One of those rules is that you should post to the right subforum (in this case your entire thread is about the customization of some 3rd party script, but you have yet to let anyone know what that script is). So not only are you not being forthcoming about your real question (in this case how to customize some unknown script package you didn't write, but you also posted this with a subject indicating it's about sql, which it isn't, in the wrong subforum. Then to top it all off, you don't provide any code. This whole thread is a waste of time.
  12. The reason I gave you the code was to prevent tampering. Certainly you could send any name, but then I could go ahead and tamper with the url like this: http://www.balancewalking.com/bwcoachinvite.php?name=adolfhitler Also, obviously it is just showing the name garbled together, which isn't really what I was trying to illustrate. Of course if that works for you, far be it from me to complicate things, however the array gives you a way of setting up the list of people to feed the links. One of the common ways to maintain something like that would be to have the names in a table, which you can update using phpMyAdmin, or a flatfile. There's many different ways to handle it.
  13. Sure thing. One thing that differentiates unix is that for security reasons, the current directory is not in the path. This is meant to help prevent people from inadvertently running bogus versions of common commands, rather than those in the path. For this reason, if you have a script in the current working directory, and you try and run it, it won't be found unless you add the current directory path. It's an oddity of *nix shell configuration that differs from windows and DOS who tend to include the . directory in the path, so that the current directory is searched first. At any rate, that is why you have to specify ./myscript, only when you're trying to run a script in the current directory.
  14. Ok, so I understand your frustration, but in fefense of Mchl, he's posted 4k times here, and many of the posts have offered in depth help. I think he was trying to answer your question. No harm no foul --- let's try and bring this back to a constructive conclusion. What you need is pretty simple -- a table between Users and Options. I will typically call a table like that UserOptions or something along those lines. That table needs only the keys to the tables it sits between: In your case, it appears that the primary key of Options is the "val" column and the primary key of users is username. userOptions ---------- username val Both columns should be part of the Primary key. I did cover this topic fairly well some years ago in a tutorial series i wrote for phpFreaks, but sadly that went into the bitbucket. There is a .pdf version of the series, and I have some code and at least one way to handle the UI, so you can get an idea of the SQL issues. You can skip to part 2 & 3 if you want, as that's where i talk about many to many resolution and the physical tables and SQL joins needed to make that stuff work. The series in .pdf and the code is all available here -> http://www.gizmola.com/blog/index.php?serendipity[subpage]=downloads&thiscat=6&file=20 Now in terms of only allowing 3 options, that is something that you will have to handle in code, because the many to many has no such limitation. For example, one really simple way is to simply have the UI handle this as 3 seperate drop down list boxes. Or, you can go for a more complicated UI widget as described. Probably the simplest code, is that when any change is made through the UI, you delete all the options for that user and create the new ones based on the UI. Technically it will not be possible due to Primary key uniqueness, for a person to have 2 options the same, using this scheme, so that is also something you probably want to check in your validation code. Another option is to write a mysql trigger that enforces your 3 or less rule. I'd probably opt for doing the checking in a validation routine personally.
  15. thorpe, It sounds like what you really want is to have the developers work in branches. That is the only way that you'll keep things out of the trunk. Eventually of course, branches have to be merged back into the trunk and this can be a problem with svn, especially if you have developers that aren't that savvy. If you do go this way, have the developers use http://www.orcaware.com/svn/wiki/Svnmerge.py to help with the merging process. Personally, my feeling is that what you do is: -Make a Release Tag for your current state of code. Disallow any further trunk commits until you get this setup. - Make a branch based on this "release" tag. -Have the developers work in the branch (again make sure they init their areas using Svnmerge.py). When you are in "Release Candidate Testing" Merge into trunk and make a release Candidate Tag. Your Continuous build/Test site can be setup to build from the RC. During the RC period, you put bug fixes directly into the Trunk, so that you don't have to worry about merging. Testing QA goes against this, and the continous build/ testing site should be building from the trunk. How you manage this often depends on how rigid QA is (assuming there's a seperate group). Whenever you have enough bug fixes to warrant another RC phase, make a new RC Tag. Repeat until you have signoff. When you do your production release, Tag production based on the RC (if you're rigorous about that process) or the Trunk, if you're greenlighting whatever the state of the latest build is. Next development phase -- make new branch off the release tag. This process insures that you are always testing off a merged tree, so that you will never get post release merge regressions or abnormalities, whilest you also get the benefits of branches and tags for release mgmt and testing. Also if you guys can afford it, I highly recommend Fisheye and Jira to get the most out of svn and bug fixing. You can get everything tightly integrated, so that for example, developers working on bugs, commit with a jira bug id, and you'll have the jira case linked to the svn commit that fixed it. Amazing stuff, when it's all setup.
  16. This is the nature of RHEL ... they lag far behind current releases with their packages. If you want anything nearing current PHP, Apache and MySQL releases, you need to use 3rd party package repo's. The ones you will need are the EPEL repo and the Remi repo. Google them both and do some reading about how to get the packages from their repos, and how to use up2date with them. Remi is french, so make sure you find the links to the English version of his instructions.
  17. Ok, so I'm not sure why you are putting the '.' (current directory) in all your paths. When you cd to a directory to attempt to run it there, it's appropriate, but not when you're running it from some other directory like: /./var/www/vhosts/lasmi1.net/httpdocs/tester That should just be /var/www/vhosts/lasmi1.net/httpdocs/tester So the first thing to check is: did you set the permissions on the script so that it has the executable bit? You can check this with "ls -lath" To set the executable bit for all users: chmod ugo+x tester
  18. Yes, this is what happens when you don't have normalized table design. In users, your Option1, 2 and 3 columns are a repeating group. The proper design involves a many to many resolver table between Options and users, because that's what the real relationship is: Users >--- There are definately queries that you will find difficult if not impossible to do with that structure, in particular -- find all the users who have one particular option set, or worse, have 2 options in some combination. With that said, here is how you go about accomplishing what you asked for with a structure similar to what you described. mysql> select u.*, o1.options as option1, o2.options as option2, o3.options as option3 -> FROM Users u, Options o1, Options o2, Options o3 -> WHERE o1.val = u.Option1 AND o2.val = u.Option2 AND o3.val = u.Option3; +----------+---------------+---------+---------+---------+-----------+-----------+---------+ | Username | Email | Option1 | Option2 | Option3 | option1 | option2 | option3 | +----------+---------------+---------+---------+---------+-----------+-----------+---------+ | Bob | bob@there.com | 3 | 1 | 5 | Ice Cream | Veg | Bread | | Fred | fred@here.com | 2 | 4 | 6 | Meat | Pop Tarts | Candy | +----------+---------------+---------+---------+---------+-----------+-----------+---------+ 2 rows in set (0.00 sec) mysql> select * from Options; +------+-----------+ | val | options | +------+-----------+ | 1 | Veg | | 2 | Meat | | 3 | Ice Cream | | 4 | Pop Tarts | | 5 | Bread | | 6 | Candy | +------+-----------+ 6 rows in set (0.00 sec) mysql> select * from Users; +----------+---------------+---------+---------+---------+ | Username | Email | Option1 | Option2 | Option3 | +----------+---------------+---------+---------+---------+ | Bob | bob@there.com | 3 | 1 | 5 | | Fred | fred@here.com | 2 | 4 | 6 | +----------+---------------+---------+---------+---------+ 2 rows in set (0.38 sec)
  19. It really does matter whether or not you are using Flash. I'm going to assume that you are, and you have the source for the flash player. What you can do, is use the flash externalAPI which allows you to call a javascript function. Check this out, and maybe google a bit: http://www.adobe.com/devnet/flash/articles/external_interface_05.html So conceptually, what you need to accomplish this is have a function that does some magic in the location of the video. One option might be to have a background image and you hide the player, or perhaps fool with the z-index of overlapping divs, where your javascript function moves the image to the front. Also in flash you need to have an event listener that fires this code when the video is done. Conceptually, this is possible with flash, but in this case I have never tried to implement this idea, so I'm afraid it's only my best guess in regards to making this work.
  20. Also -- $file_url variable is not being used *now*. Obviously it was being used before, incorrectly. I don't know what you are planning to do with that variable, but at least you stopped using it for now.
  21. ultimachris --- If you really want help, you need to read what is being written to you. At the top of these posts I asked you to use the code tags around your code. I inserted them in your original post, but I don't want to keep doing that. To answer your question, where PHP sticks temporary files is a function of the php configuration done in the php.ini file. In your case it is using the /tmp directory on the server. From there, PHP will simply create a random file name, to obscure what is going on. You really don't need to be concerned about that. It is not the current problem. The current problem is either that the path is invalid: /htdocs/urbantickets/widgetimg/ or it doesn't like your extra / in the path: /htdocs/urbantickets/widgetimg//skyrocketpagerank.gif If you look at your code, you can fix this either in the url variable or by omitting the extra "/" you concat on there.
  22. The error is pretty much telling you what is wrong. Your destination path/filename is a url for some reason. It doesn't appear you've provided the code you are using, as it looks as if you somehow are injecting a url into the destination parameter when it should be a simple path and filename on your server. What is the code you are using right now?
  23. basic ssh allows you to specify commands following your parameters, easiest way being ssh user@remoteserver "ls -la". This works, if you already have keys setup on each server. However, the Putty distribution also provides a command line tool called plink that is designed for doing automated stuff. What you want to do is setup a profile in putty and save it with the server credentials, name and password saved etc. You can then do something like this: $output = `plink sessionname asterisk -r`; echo $output; Note that I used backticks as I mentioned previously and not regular single quotes.
×
×
  • 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.