-
Content Count
14 -
Joined
-
Last visited
About TheChosenDarkness
-
Rank
Newbie [Level 1]
- Birthday 01/27/1984
Contact Methods
-
Website URL
http://www.abreedersquest.net
Profile Information
-
Gender
Female
-
<form action="pasture.php" method="post"><textarea name="layout" id="layout" columns="40" rows="20"> </textarea><br><input type="submit" name="submit" value="Update Layout"></form><?phpinclude ("connect.php");$result = mysql_query("INSERT INTO members VALUES (layout);SELECT * FROM members WHERE layout = 'layout';UPDATE layout WHERE layout = 'layout'")or die ('cannot select member info');$row = mysql_fetch_array($result);echo "ID:".$row['layout'];?> *sighs* I have a headache from my head meeting my desk so much. XD lol Any way.. I have something that actually works in the sense it tells me "cannot select member info". Which is a start. However, before anyone says I need to "SET" just remember this form is for my users to "DECORATE" their page. As in the code needs to be updated frequently. As in there is no EXISTING data to update until the form SUBMITS said data. *sighs* Closest thing I can think of to describe this is a blog or a personal forum that just deletes and updates the data submitted by the form each time a member decides to change something on their page.Any way.. does anyone know where I went wrong?
-
Okay, I am trying to get "layout" content to insert into a database and then "retrieve" it. So it will stick on the page I want it to. However, I am not sure what to tell the code to insert. I have a form and I basically want the form insert "text" into the database.For example.. where the name and age is on the example.. what would I put there to tell the code to "insert" the layout data?---To better phrase the question: How do I get to form to insert the data into the database? Much like you do with registering users, except I want to insert text. Like in layouts or stories, etc. That way I can retrieve it and have it "stuck" to the page until I user wants to change it.
-
Yes, very true. Hmm... I seem to have insertion and retireving down pat. However, when I go to change the data the original data I input is still there. So I tried my hand at "updating" and well.. I can't get it to update properly. I may try the txt file thing until I can figure out the database solution to this problem.
-
I am learning slowly but surely and I know some of you probably getting tired of my questions. ^^;; However, I believe one can not learn without asking questions. So.. if I get too bothersome.. just point me to some books or something. lol XD <?php// Make a MySQL Connectionmysql_connect("localhost", "name", "password") or die(mysql_error());mysql_select_db("at2927_abq") or die(mysql_error());// Insert a row of information into the table "example"mysql_query("INSERT INTO members (pasture) VALUES('Timmy Mellowman', '23' ) ") or die(mysql_error()); echo "Data Inserted!";?> Okay, what Value or Values do I need to put? I am making a page decorator for my registered users and I want the text to "stick" to the page. I was told I would need to "insert" the data and the "retrieve" the data in order for it to stick. So.. what Value(s) would I use?Here is the form I created (with help of course): <?phpif(count($_POST) > 0){$changepage = $_POST['changepage']; // do any extra formatting you need to the string var $changepage here // output it back hereecho " <tt>$changepage</tt> ";}?><form action="pasture.php" method="post"><TEXTAREA class="text" name="changepage" COLS="80" ROWS="15"><?phpecho "$changepage"?></textarea><br><input type="submit" value="Change"></form> So I want to take the submitted data and make it "stick" to the page. So what would be the Value for the database to store and then for me to retrieve?Hoping I got the database set up right for this type of insertion and retrievial. =]
-
I was afraid of that. I was hoping there was a quicker or easier way to make it stick. ^^;; However, that does make sense. I guess that means I must make a row under members that is for their account page. Which I call pasture. Then write a code to INSERT the information and then retrieve it. *sighs* Here I go. XD---Oh.. I will got take a quick look at that site from the link you provided. It might work. If it doesn't I will do it the long way around.
-
Oh it has no mistakes and it works beautifully. However, I am trying to create something that will stay on the page until the user wants to change it themselves. That is the problem I seem to be having. Everything works wonderfully, but when I hit "enter" and reload the page the information is longer there. I am trying to figure out a way to make it stay there. If that makes any sense. ^^
-
<?php$changepage = $_REQUEST['changepage'];echo " <tt>$changepage</tt> ";?><form action="pasture.php" method="post"><TEXTAREA class="text" name="changepage" COLS="80" ROWS="15" WRAP="OFF"></textarea><br><input type="submit" value="Change"></form> Okay, I need a way for any information typed in my textarea to "stick" on the page in which it "posts". Since I am creating a way for my registered users to decorate their "homepages". So any help, tutorials, etc. would be greatly appreciated. ^^Thanks.
-
Mysql Query Problems I need some help or a tutorial?
TheChosenDarkness replied to TheChosenDarkness's topic in Programming
I finally fixed this problem. So it has been resolved. I took out the "WHERE" statement and just used "FROM members" and it posted the ID# just fine. ^^ I guess I was trying to be to specific with asking the database what I wanted.Thank you all for the help. -
Mysql Query Problems I need some help or a tutorial?
TheChosenDarkness replied to TheChosenDarkness's topic in Programming
Here is the thing. I don't get an error. It is just there is no ID# posting on the page. I have tried everything I can think of. I am fixing to check a few other things before doing some the suggestion posted here. To see if I messed something up in my coding.Thanks for the help everyone.---Concerning the BBcode and the codebox. I will try to remember the codebox next time. ^^ I was in a hurry. I had to leave for work and didn't know when the next time I would be able to get online to check this. =] -
Mysql Query Problems I need some help or a tutorial?
TheChosenDarkness posted a topic in Programming
I seem to be having trouble with getting my Query to post my user's ID numbers. // Make a MySQL Connectionmysql_connect("localhost", "user", "password") or die(mysql_error());mysql_select_db("databasename") or die(mysql_error());// Retrieve all the data from the members table$result = mysql_query("SELECT * FROM members WHERE id='$id'")or die(mysql_error()); // store the record of the id table into $row$row = mysql_fetch_array( $result );// Print out the contents of the entry echo $row['id']."; A little information about my table in my database: table called: members under members rows called: id, username, password, pname, cname, email, ip under row called id: the user's information is stored. So can someone help this fast learner on how to get the Query to run properly and actually "post" the ID# on the pages of my website? Any help will be greatly appreciated. ^^ Notice from truefusion: Added CODE bbcode -
Saint_Michael started following TheChosenDarkness
-
Yes. Exactly on the example about Punnette Squares. =] Also, I tested the code below and it works just fine. Now I just need to add a form to it so people can choose the color or genetics to generate the outcome. Correct? My hosting company just recently upgraded to PHP 5. So.. I am still working on understanding certain aspects of PHP 5. Since I have been mainly studying PHP 4 and testing PHP 4. Thank you again and the code was very helpful. ^^ TCD
-
Okay, I have created, looked, and generally studied simple PHP calculators. However, I can not seem to find any tutorials on how to create a genetic calculator. One that calculates genetic percentages similar to that of Punnette Squares. I have seen plenty of websites that have these types of calculators, but I have yet to see any websites offer tutorials on how to create these types of calculators. So.. does anyone know of any tutorials I can find or sites that might have the tutorial I am looking for? Maybe even a tutorial here?Reason for asking: I am creating a website, simulation game, and one of the aspects of the game is calculating the colors of the offspring from a certain pair.Any help on the subject is greatly appreciated.Thanks in advance,TCD