
computermax2328
Members-
Posts
281 -
Joined
-
Last visited
Everything posted by computermax2328
-
Nesting is cool and all, but the real reason I use SASS is for variables like I said before. Saves a lot of time! You don't have to address multiple id's for just one CSS statement. Makes things a lot more organized. For me at least.
-
Adding popup image of url you hover over!
computermax2328 replied to mdexter's topic in PHP Coding Help
You can start by watching something like this. Someone correct me if I am wrong, but where he uses toggle you can use .hover(). Look into Jquery first of course. There is some set up in your document that will be required in order to use Jquery. -
I don't know much about javascript, but what I can tell you about your PHP script is that your logic is wrong. if($_POST['username'] < 5) This if statement would work if the $_POST was an integer. Because it is not the if statement automatically fails. You could use the PHP function strlen() which is string length and do something like this.... $string = strlen($_POST['username']); if($string < 5){ //Do whatever } Also, I would look into using the PHP function switch instead of so many if/else statements. If you have any other questions feel free to ask.
- 7 replies
-
- validation
- form
-
(and 2 more)
Tagged with:
-
Adding popup image of url you hover over!
computermax2328 replied to mdexter's topic in PHP Coding Help
There are a number of ways that you can achieve this, but PHP is not one of them. Onmouseover is something that you would use with javascript or jquery. Just Google it or look on Youtube. -
Where are you at with this? Did you try using a MYSQL JOIN? Post what you have just for the query.
-
CSS doesn't have it, but SASS does. SASS is pretty much CSS on steroids. It saves a lot of time and aggravation. Not only does it let you nest elements, but it also lets you assign variables to values. So instead of having to scroll through your style sheet for that hex-code or rearrange and reorganize your structure, you can do something like $white=#fff; and use it over and over again. Give it a try.
-
Critique My Website and Give Suggestions
computermax2328 replied to madjack87's topic in Website Critique
Pretty basic stuff, but it looks good. I filled out your free quote form to test it form you. Don't send me a quote! You should try making it a fluid site with percentage widths and heights. Look up preload images too for your gallery and background. Other than that, good work! -
mysql_query("UPDATE participantlog SET noshow='1' AND hours='$value' WHERE cid='$cid' AND uid='$keyd'") or die(mysql_error()); In your query here, are your cid and uid stored in your database as integers? If they are, remove the ''. Quotes are for strings, not for integers.
-
Take your if(isset()) out of the while loop. What you want to do is have the page say if(isset(submit button) then delete this entry based off of the id that is provided from the form. Then if the submit button is not set loop through these entries.
-
Don't break up your $query variable.... $query = "INSERT INTO links (comp_cat, comp_name, comp_link, comp_desc, comp_addr, comp_county, comp_city, comp_state, comp_country, comp_logo, comp_date)"; $query .= " VALUES ($comp_cat, '$comp_name', '$comp_link', '$comp_desc', '$comp_addr', '$comp_county', '$comp_city', '$comp_state', '$comp_country', '$comp_duration', '$comp_date', '$comp_logo')"; if (mysqli_query($link, $query)){ } Your INSERT statement and VALUES are all one long command. Right now your $query variable is set to the second $query variable. Also, do what requinix says and use prepare()
-
I think that you are confused about what cyberRobot said. You can select the column you want, send it through a loop and use array_count_values() or count() to count all of the values in the column. Only loop the data in that column.
-
You use a mysqli_query but a mysql_num_rows. Use mysqli_num_row $matches=mysql_num_rows($data); **EDIT: Woop Jazzman1! I must have posted right after you.
-
Take the double quotes out like I said. You don't need to concatenate your variables. $sql = "UPDATE articles SET art_title='$art_title'........ Also make your POST id a variable $id = $_POST['ID'];
-
Don't concatenate inside of MYSQL queries. Assign variables to your $_POST['ID'] You don't have to escape all of those double quotes. Only use quotes for stings and use single quotes inside of double quotes.
-
Add single quotes around $the_date and $ticker to indicate that they are strings. Then tell me what happens.
-
Warning: mysql_result() error help please
computermax2328 replied to Samza's topic in PHP Coding Help
^^^^^^^That's the guy to listen to! Thanks for answering my question within a question. -
Warning: mysql_result() error help please
computermax2328 replied to Samza's topic in PHP Coding Help
You can refer to this. It is telling you that your first parameter in incorrect, so your mysql_query. The page I linked to also states that this is the slowest out of all of the functions you could use to fetch information from a database. Something I am not 100% sure about, but I would not practice, maybe one of the gurus can explain it, but I do not think it is best practices to put concatenation into a query. Turn your mysql_real_escape_string(cart_id) into a variable. I am not sure if that is a smart decision, but that is what I would do and have done in the past. Also, something I just noticed. Can you mysql_real_escape_string and id number. If it is an integer why are you trying to escape it?? -
New Job! Im Learning..But I Desire To Impress My Boss!
computermax2328 replied to JoshB312's topic in Introductions
Hey Man, Congrats on your new job! A desire to become a web developer is one thing we have in common! Seriously though, requinix is right. Slow down and make sure you know the basics. I have been learning PHP for about a year now and I have been a part of this community for about the same amount of time. The biggest mistake I see around here with new developers, not saying that I have a huge amount of experience, is that they don't know the simplest basics. How to concatenate properly, the different between a " and a ' in an echo, the proper syntax for a mysqli query. It takes time! Shadow some of the gurus and admins on here, learn from them and you will be learning proper practices in no time. In the mean time use sites like lynda.com, codeacademy and codeavengers to learn more. I also use W3Schools to learn proper function uses. Enjoy! -
mysqli_query() is $connection, $query and not the other way around. See reference link here Should be like this.... $result = mysqli_query($conn,$query);
-
Are you getting any errors??
-
Yeah if you add ORDER BY to your query..... $sql = "select * from mr_recipes WHERE id='5' ORDER BY id DESC"; See this link for reference. Also, just picking this out our your query, is your id a string or an integer? If you put '' around it you are saying that it is a string. It depends on what you saved it in your database as. Give us more information on that as well.
-
how to get data from email attachment into MySQL
computermax2328 replied to neginf's topic in MySQL Help
What format is the email attachment? -
Well that is a very broad question to ask. What kind of experience do you have with PHP? The main idea for both answers would be let user input the data->store it in a database->query it on the front end.
-
Hello all, new to this need some guidance
computermax2328 replied to cripin's topic in PHP Coding Help
How about another column for profile creation date or last payment date? Then when a user logs in you can write a script that checks if they are premium, if they are premium then it checks the data column to see if it has been 30 days or how ever long you want it to be. Make sense? -
Hello all, new to this need some guidance
computermax2328 replied to cripin's topic in PHP Coding Help
What you could do instead of adding a new column or a new table is have a column called "account type" or "account" for short. Make the data for each user either a 1 or a 2. If a user is a 1 they are a regular user, if a user is a 2 they are a premium user. That way you can just update their information when they become premium.