Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
So what exactly is outputted to the browser? What exactly is wrong? ...How does this relate to your original question? If you're just using the associative return array then call it with mysql_fetch_assoc(), if you need numerical indices use the other way. Also add the or die(mysql_error()); at the end of the query call, like this: $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_assoc($result))
-
Post the query. Also put or die(mysql_error()) at the end, like this; mysql_query("INSERT INTO `accounts` (`email`, `password`, `fname`) VALUES ('$email', '$password', '$fname')") or die(mysql_error());
-
Inline CSS: bla bla bla
-
You can put it into a hidden field to "repost" it to the next page. EDIT: You can also store it in a session or in the URL and retrieve it with the GET method.
-
Just add them into this query. Looks like you already did most of your checks. For example, if you wanted to add first name into this query, you would have to: 1) Create a column in your table called, "fname" 2) Grab the value from the post like you do with email and password. 3) Add it into your INSERT query: mysql_query("INSERT INTO `accounts` (`email`, `password`, `fname`) VALUES ('$email', '$password', '$fname')"); echo "Your account was successfully created!"; NOTE* You should really sanitize your values that go into your database with mysql_real_escape_string().
-
-
Replace the ')' with '}'. You weren't ending the isset for the submission. $result = "Error sending your message. Sorry, an error occured sending. Please try again later or contact us direct to be added to the mailing list"; }} ?>
-
[SOLVED] New to PHP and mySQL PLEASE HELP
Maq replied to desert_gold_hound's topic in PHP Coding Help
FYI: You put this in the PHP Regex section which is entirely the wrong place. Glad to see you got it working, please mark as [sOLVED]. -
Is there an echo in here?
-
There's two different styles: </pre> <form method="post" action="<?=%24_SERVER%5B'PHP_SELF'%5D;%20?>">< </pre> <form method="post" action="<?php%20echo%20%24_SERVER%5B'PHP_SELF'%5D;%20?>"><
-
[SOLVED] New to PHP and mySQL PLEASE HELP
Maq replied to desert_gold_hound's topic in PHP Coding Help
I don't really understand your question... If you're trying to get the last inserted ID from customer you have to use mysql_insert_id() right after you insert to the customer table. -
So what's your problem? Use scandir() to get the files in a directory. Use $_GET['var_name']; to get the persons name they put in the URL. Use header() to redirect.
-
I'm not sure what you have done so far. You just need to link the IP to the country and store it in the database. There is plenty of stuff on the net. http://www.phptutorial.info/iptocountry/
-
Not true, check out some benchmark tests, it will show, for this specific example, that strpo() is faster then the preg_match() function. But preg_match is much much more powerful, like br0ken already mentioned.
-
If you're still looking for gaming projects, you may want to search in these 2 sections: http://www.phpfreaks.com/forums/index.php/board,10.0.html and http://www.phpfreaks.com/forums/index.php/board,62.0.html
-
I still think that one of the ways we suggested would work...
-
I love beer...
-
Dunno how you regard my skill level, but I truly do think that it's too easy. I've never taken it, or even a mock up test, but I've heard similar things from multiple people.
-
Try: </pre> <form name="login" action="secure/checkuser.php" method="post" target="mywindow" onsubmit="window.open('mywindow', this.target,'width=400,height=300,toolbar=no,location=no,directories=no,status=no,menubar=no,titlebar=no,scrollbars=yes,copyhistory=yes,resizable=no')"><
-
Sure, you lost your $id because when you submitted the page it had to refresh and the $_GET variable isn't in the URL anymore so it just gets reset. You probably could have set the action with the variable name in it, but I like the hidden fields better
-
if I don't put an empty option, & the user don't change it, that means the user choose the wrong option. thats why I want to make sure the user choose the right one and if it is blank, it should says "you have to choose one option from the list" OK, doesn't make any sense to me but here: if(isset($_POST['submit'])) { if($_POST['list'] == "no") { echo "You didn't choose an option."; } else { echo $_POST['list']; } } ?> </pre> <form action="<?php%20echo%20%24_SERVER%5B'PHP_SELF'%5D;%20?>" method="post"> car bus motorbike </form> <b
-
Cause you need to add an extra hidden field for when you submit. You're losing the $id... Name: Link: //ADDED*** When you submit, now you have to retrieve the id via POST like so: $id = mysql_real_escape_string($_POST['id']); //ADDED* $name = strip_tags(mysql_real_escape_string($_POST['name'])); $link = mysql_real_escape_string($_POST['link']); $sqltwo = "UPDATE menu SET name = '$name', link = '$link' WHERE id = '$id'";
-
Why do you have an empty option in your select field?
-
Can you give us an EXACT sample of a piece of data that doesn't work?
-
Don't worry, I'm not either ???