|
My site
|
|
09-09-2004, 05:09 AM
Post: #11
|
|||
|
|||
|
RE: My site
trying now...................... ahhh, now we are getting somewhere
Quote: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 'desc,rate,type,pic) VALUES ('2','test','test','test','test','', |
|||
|
09-09-2004, 05:20 AM
Post: #12
|
|||
|
|||
|
RE: My site
mysql_query("INSERT INTO download_items (catid,mplink,name,dllink,desc,rate,type,pic) VALUES ('$catid','$mplink','$name','$dllink','$desc','$rate','$type','$pic')") or die(mysql_error());
That should work. Chris Boulton Twitter | Blog |
|||
|
09-09-2004, 05:44 AM
Post: #13
|
|||
|
|||
|
RE: My site
ok, I used your suggestion and WDZ's (desc was reserved or something like that) and now it works. Thanks Chris.
4 new questions: Code: <option value="0" <? if ($_REQUEST['rate'] == "0") echo "checked"; ?>>0 - Not Yet Rated</option>I want a password code so only I can enter the "Add download" page. Please can someone lead me to the right site or give me a code here that can do just that?? I want it to echo each part of the script, eg: catid added..... mplink added..... name added..... etc etc And finally, I want it to redirect me back to the add download page. Please help. |
|||
|
09-09-2004, 11:31 AM
Post: #14
|
|||
|
|||
|
RE: My site
Code: <option value="0" <? if ($_REQUEST['rate'] == "0") echo "selected"; ?>>0 - Not Yet Rated</option>Quote:I want a password code so only I can enter the "Add download" page. Please can someone lead me to the right site or give me a code here that can do just that?? I haven't tested this, but theoretically this should work.. Code: <?phpQuote:I want it to echo each part of the script, eg:I don't understand that. Quote:And finally, I want it to redirect me back to the add download page.header("Location: file-to-redirect-to.php"); That's assuming that you haven't printed anything to the browser yet.. That will redirect you to where you want to go. Chris Chris Boulton Twitter | Blog |
|||
|
09-09-2004, 05:35 PM
Post: #15
|
|||
|
|||
RE: RE: My site
Chris Boulton Wrote:I think he wants the script to verify it actually added the info in the db. So he wouldn't have to manually check on it.Quote:I want it to echo each part of the script, eg:I don't understand that. Main SETI@Home project closed, but was picked up by BOINC. It allows you to crunch data for different projects like SETI, Einstein, & more...Check it out. |
|||
|
09-11-2004, 03:54 AM
Post: #16
|
|||
|
|||
|
RE: My site
Thanks Chris. Its working now
New questions: 1. Is this how to put a [Delete] button next to name so it deletes the table I want without having to go into mySQL?? Code: $sql = "DELETE FROM `download_items` WHERE id = '$id' LIMIT 1";2. I also want a [Edit] button that pulls the info from the download, onto a form in the right places, and allows me to edit it. How can that be done?? (just like this baord, when you click edit, it pulls the name of the thread description etc. If it is too hard, Ill just have to edit it in mySQL )3. I have game and program downloads. I want to have a select box that has to be chosen first to open up the other selections. eg: Select1 and Select2. Select one asks for Game Download or Item downloads. If items is chosen, it displays the catagories in select2, if game is chosen, differnet ones. See what I mean?? Currently, only 1 is possible, I dont want to have to make two forms. So until Select1 is chosen, can select 2 be greyed out somehow?? Next, I need the coding. Most probably an if statment, like Code: if "select == item {Thanks for the help so far everyone. |
|||
|
09-11-2004, 04:09 AM
Post: #17
|
|||
|
|||
|
RE: My site
I read what WDZ and Lobster said on the Messenger Plus! forums and I tend to agree with them. You should be learning this yourself - throug the manauls and stuff.
To delete stuff, you will need to do something like: Code: <?php(Thats a very simple version of it). You will then need to link to it from your other script, something like <a href="delete.php?id=$id">Delete</a>. With your edit form, you can pretty much copy your add form but just set the values of the form to the current link being edited.. fetched by something like. Code: $query = mysql_query("SELECT * FROM download_items WHERE id='$id'");Code: <input type="text" name="name" value="<?php echo $download['name']; ?>" />For your categories you put a select box on a page with the two options, then you can do something like this (assuming the select box is called type) Code: if($type == "games")Chris Boulton Twitter | Blog |
|||
|
09-11-2004, 06:20 AM
(This post was last modified: 09-11-2004 06:23 AM by k776.)
Post: #18
|
|||
|
|||
|
RE: My site
Firstly, its not that I am not learning, I just learn faster when told what to do, cause then I memorize it. I had almost got there using the instructions at webmonkey (delete.php was like you said, I little modified though) and I linked to delete.php, however, it would have taken longer to have found out I needed ?id=$id at the end. So thanks for that Chris.
However, anything wrong with this line?? It wont work (parse error) :( Code: if (!mysql_query("DELETE FROM download_items WHERE id = '$id'");) { |
|||
|
09-11-2004, 06:24 AM
Post: #19
|
|||
|
|||
|
RE: My site
if (!mysql_query("DELETE FROM download_items WHERE id = '$id'");) {
You dont need the ;. Chris Boulton Twitter | Blog |
|||
|
09-11-2004, 06:55 AM
(This post was last modified: 09-11-2004 06:59 AM by Matt Light.)
Post: #20
|
|||
|
|||
|
RE: My site
k776,
What makes you believe that we trust that you learn faster by people telling you how to do something? You've told me before that you know PHP but clearly you don't so why should we believe you aren't just using people to write your code for you? If you would take the time to read some articles and at least the language reference of the PHP website, you would have at least some idea of how to do simple stuff like an if statement correctly instead of Code: if "select == item {Matt Light MattLight.com If you want my help, be sure to follow the posting tips. |
|||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)
Search
Member List
Calendar
Help






)