aquatsr
-
Posts
220 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by aquatsr
-
-
What's the best way to backup my database? (I use PHP MyAdmin thru CPanel)
-
Install Mysql
in PHP
This site helped me out.http://www.php-mysql-tutorial.com/install-...e-php-mysql.php
-
I don't need to. Each field that enters into the database automatically has the first letter of each string made into an uppercase, so I only need to select uppercase.(and actually, the query works whether a lowercase or uppercase letter is used, at least in my case)another thing:isnt the LIKE clause case sensitive?So make two queries like that, and on the first one use the lowercasing function (not sure what that is) and the second us ucfirst(). -
It gives an error:Could not query the database:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNIQUE genre FROM songs WHERE genre LIKE 'I%' ORDER BY genre ASC' at line 1(It's the same whether it's I or r or any letter, regardless of case.)
-
How would I rework this query?
SELECT UNIQUE genre FROM songs WHERE genre LIKE 'r%' ORDER BY genre ASC
because it doesn't work.(I'm not good at SQL)
-
Thanks!Use the UNIQUE keyword:SELECT UNIQUE album FROM songs ... -
Thanks! I'll be sure to try that!Try this. This will return only records start with number. will not even blank.Select * from Books Where Title like '[0-9]%' -
You're right. Thanks for pointing that out.It's not a good practice to include GET (or any other user form) variables directly in a query like that, you are leaving yourself open to attack. It would be better to use this:$sql = "SELECT * FROM songs WHERE title LIKE '" . mysql_real_escape_string($page) . "%' ORDER BY " . mysql_real_escape_string($sort);
-
Hmmm no... it's not that. I don't think the problem has been solved completely .I guess PHP doesn't like setting variables that have the same name as the querystring. -
OK so in my databast driven site I like to give the user a variety of choices in sorting by starting letter and catogory. The problem is that when I say, like "Sort by album starting with letter P I get:Phobia - Breaking BenjaminPhobia - Breaking BenjaminPhobia - Breaking BenjaminPhobia - Breaking BenjaminPhobia - Breaking BenjaminPhobia - Breaking BenjaminPhobia - Breaking BenjaminPhobia - Breaking BenjaminPhobia - Breaking BenjaminPhobia - Breaking BenjaminPhobia - Breaking BenjaminBasically it shows every entry that has that... which is good if I was showing the individual song titles - but I'm not. How can I show that my database has Phobia, but not have it show every entry?
-
PHP Nuke, maybe? It's pretty popular from my POV.thanks so much for all your help, guys!any recommendations for content management systems? ultimately i'd like to build one, just so i'll understand exactly what's happening, but for my current project the smart thing is probably to get it up and running, rather than sitting on it another few weeks while i hack away at a new programming language...thanks again!jason -
I don't know exactly how to do what you want but I do know that you can use javascript to achieve your goal.
-
Interesting! Thanks a lot! That will save a lot of code-writing!As $page now hold the value found from the get statement you can put it straight into your $sql statement so you don't need to write a line for each letter of the alphabet. And you might as well stick the sort term in as well.$sql = "SELECT * FROM songs WHERE title LIKE '{$page}%' ORDER BY {$sort}"; -
I'll try that, if it really does work it won't be a problem as I don't have any blank entries (yet).thx.You could try this:SELECT * FROM books WHERE title < 'A'This would give you titles starting with a number - but also blank entries as well. -
I have a URL, sayhttp://mywebsite.com/thispage.php?page=a&sort=titleand in my php page I have<?php$page = $_GET['page'];$sort = $_GET['sort'];/*and I want to get all entries with titles starting with the letter A sorted by title, for now*/if ($page == 'a' && $sort =='title') {$sql = "SELECT * FROM songs WHERE title LIKE A%";}else if ($page == 'b' && $sort == 'title') {$sql = "SELECT * FROM songs WHERE title LIKE B%";}...else { /*whatever*/}?>Will this code work?
-
So I have a table called books and I want to select all titles that start with a number (any number), how would I do such a thing?
-
So I have a table called books and I want to select all titles that start with numbers (any number)?thx.
-
I see. I was just offering a suggestionthanks justsomeguy, that was extremely helpful :)aquatsr: I'm not using a forum in this particular case, I am merely trying to integrate a membership system from scratch into my current webpage design. it may sound like reinventing the wheel, but there is a reason for it. Both hotscripts and phpfreaks both have scripts that do membership systems, but they were all missing the "remember me?" part, not sure why, apparently alot of authors seem to think saving cookies is a bad thing (shrugs) there is a big difference between tracking cookies and session cookies.thanks justsomeguy -
And to add to that, unless it is stated otherwise, all images, text (media in general) is automatically copyrighted by the author when created according to U.S. copyright laws.So when in doubt, ask for permission.
-
lol. I know what you mean.You can only user the Location: blah blah at the beginning of the document. (Actually you can only send the header once, is what I mean)Check there for more info: http://sk.php.net/manual/en/function.header.phpI need it to do what it needs to do, -
Thank you. I had forgotten about that (I'm still new to sql queries).Use the wildcard in your select egSELECT titles FROM books WHERE titles LIKE 'A%'Have a look at sqlcourse.com -
The sites below contain non-copyright photos which you may use freely.www.freestockphotos.com, www.geekphilosopher.com, www.bigfoto.com, www.firstgov.gov, www.sxc.hu/index.phtml.And in general, you can use pictures from Google as long as you ask permission and give credit for the picture where due.hello,yesterday i was searching for a web site with images that i can use in my sitethe kind of pictures that make the site look goodis there is such site or i should google for my picturesneedless to say i want a free one -
Ditto. As a college student I'm always looking to get something for free.Well, I'd be happy to use one if I could find one I didn't have to pay for. -
So I have a table called books and I want to select all titles that start with 'a' or 'A' how do I do such a thing? Also how would I do that for titles starting with numbers (any number)?thx.
Will this code work?
in PHP
Posted
Oh that looks useful! Hmmm fortunately I don't need to use it, thx tho!(My project is in my sig, u can take a look at it)