Jump to content

jgreen

Members
  • Posts

    22
  • Joined

  • Last visited

jgreen's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I've been searching for a customized registration form for a membership plugin for a week. If you know of a membership plugin with a social wall plugin that someone can customize by all means list it here. It also needs - Front-end Registration - Front-end login - Front-end posting - Front-end comments.
  2. Ch0cu3r, Thanks for the help but didn't actually solve the issue. But it was a great answer for someone with a somewhat similar problem.
  3. I'm looking for an application or a social wall plugin to be added to a project. After looking at Wordpress and finally sifting through all the plugins (maybe all), I have come to a conclusion the plugins are not giving me enough customization options. For example, customizing the registration form. I need to add javascript for a combo box in order to display different options depending on what was selected. What I need - Your Opinion on a good social wall that's easy to make changes. I need a secure login and password --- PDO based A control panel would be nice to activate users or deactivate. A customized registration form Ability to add more pages, add php to customize it to work like I need it to. Responsive. If anyone has an opinion with experience on this matter it would be great to hear from you.
  4. Thank you very much for the information. I hope you're coding plus teaching people you have that ability to do so. The hidden fields - No the users cannot edit those fields but I was using those fields to post so I can also populate an email with those values. The email is sent when submitted. I tried what you posted and made a little head way just trying to figure out how to hold on to those variables in order to populate the email. On the other side, linking the tables would be great. I'll work through your suggestions more and let you know. Thanks again.
  5. Ch0cu3r, Thanks for explaining. I've done what both of you have described. This is the reason I said this earlier "If you're saying put it under the insert at the top of the page that will NOT work." The reason I say, "This will not work" is because of this error - "Column count doesn't match value count at row 1". It says this because the insert has more columns than the select. This keeps getting skipped over. The form has more than a combo box. I mean really who would have a combo box only and a submit button... Even if I did not say there's more on the form, it would only make sense. It wouldn't make sense to have 2 tables with the same data. The form also has First Name, Last Name, email, etc. that gets inserted into table 2. There's also, as you know - bookid, name, cover, pageno coming from the combo box. If I remove First Name, Last Name, email, etc. Barand's code works but only if the columns are =. There are 2 tables table1 (books) & table2 (users)< this table needs the book selected combined with the user info. I'm sure there's a way to do this but not sure how the sql should be written. Again thank you for going into detail explaining what Barand was saying, it helped a lot. It's too bad your not understanding it's bigger than a combo box and a submit button. If I'm wrong for thinking this please explain. Tell me what the issue is since it seems you can explain things in detail so people can understand. Here's the code - INSERT INTO table2 (firstname, lastname, address, city, state, zipcode, email, book_id, name, cover, pageno) SELECT book_id, name, cover, pageno FROM table1 WHERE book_id = $posted_id Table 1 - book_id, name, cover, pageno, bookcopies Table 2 - firstname, lastname, address, city, state, zipcode, email, book_id, name, cover, pageno
  6. Also there isn't a subsequent page so seems you're confusing me with another. It's a form and after submit goes directly into a db.
  7. No I'm not confusing the issues. I have the code right here in front of me and know how this form works. This is the same combobox AND you didn't give me that code to populate the dropdown, I already had that done. What you did though is select the data and determine how many records exist. If those records match the fulfilled amount then not to display those book names in the combobox. This is the same combobox... and the other issue after you fixed the first one is to populate the second table with the other entries. And trying to find a solution on how to do that. It did NOT contain "WHERE b.book_id = $posted_id". No kidding... this is what you posted for the select so I added it. Where does this code go? If you're saying put it under the insert at the top of the page that will NOT work.
  8. Barand, My apologizes someone posted after you and I didn't see it. Looking at this on my phone. I added your code SELECT b.book_id, b.name, b.cover, b.pageno, b.booktotal FROM books b LEFT JOIN users u USING (name) GROUP BY b.name HAVING COUNT(u.name) < b.booktotal WHERE b.book_id = $posted_id But it doesn't populate the db. When I remove your code WHERE b.book_id = $posted_id it populates. Can you tell me what this issue is? Thanks
  9. I have a form and I'm populating the combo box as you see in my code. I'm populating the combo box from a table called books. The form populates a table called users. Each user will select a book and that table gets populated with user info plus the book name, cover, and pageno. Since the combo box name is "name", I can only post the book name. This is why I have two hidden fields that I'm trying to populate with the other variables cover and pageno. Does anyone have a javascript solution? I tried this code below but again only get name since the id is on the select.... not sure how to change it to get all variables - name, cover, pageno <script type='text/javascript'> $(function() { $('#myselect').change(function() { var x = $(this).val(); $('#myhidden').val(x); }); }); </script> <input type='hidden' id='myhidden' value=''>
  10. I have 3 variables coming from 3 columns from a table. I want to insert these variables into 3 columns in a different table. Variables are name, cover, and pageno. The issue is I can see the values in the hidden inputs this is when the page loads when nothing is selected in the combobox??? If I select book number two the same values are in the hidden inputs. If I select book one this is what I see because when the page loads it populates the values as book 1. <input type="hidden" name="cover" value="cover 1"> <input type="hidden" name="pageno" value="pageno 1"> If I select book two this is what I see. <input type="hidden" name="cover" value="cover 1"> <input type="hidden" name="pageno" value="pageno 1"> Make sense? If not, no matter which book I select I see the same values. Here's the code. <select name="name"> <option value="<?php echo "{$_POST['name']}"; ?>"> </option> <?php include('theconnection.php'); $con = mysqli_connect($host,$user,$pass,$dbName); if (!$con) { die('cannot connect: ' . mysqli_error($con)); } mysqli_select_db($con,"thebooks"); $result = mysqli_query($con,"SELECT * FROM books"); $result = mysqli_query($con,"SELECT b.id, b.name, b.cover, b.pageno FROM books"); $cover = ''; $pageno = ''; while($row = mysqli_fetch_array($result)) { echo ("<option value='$row[name]'>$row[name] $row[cover], $row[pageno] </option>"); $cover = "$row[cover]"; $pageno = "$row[pageno]"; } ?> </select> <input type="hidden" name="cover" value="<?php echo $cover; ?>"> <input type="hidden" name="pageno" value="<?php echo $pageno; ?>"> Maybe Javascript will work? I can't figure out how to do this with Javascript either.
  11. I found away that works for the code that I have. There's one issue. 1. If there's more than one book title it will echo all book titles for name, cover all cover names, and all pageno for all books. 2. When the db is populated it does the same as the echo, it populates the columns with all - names, covers, and pageno's for all books instead of the specific book selected. I'm not sure how to loop through the inputs and print only the book selected and populate the db with what was selected only. I hope that makes sense. <select name="name"> <option value="<?php echo "{$_POST['name']}"; ?>"> </option> <?php include('theconnection.php'); $con = mysqli_connect($host,$user,$pass,$dbName); if (!$con) { die('cannot connect: ' . mysqli_error($con)); } mysqli_select_db($con,"thebooks"); $result = mysqli_query($con,"SELECT * FROM books"); $result = mysqli_query($con,"SELECT b.id, b.name, b.cover, b.pageno FROM books"); $cover = ''; $pageno = ''; while($row = mysqli_fetch_array($result)) { echo ("<option value='$row[name]'>$row[name] $row[cover], $row[pageno] </option>"); $cover .= "$row[cover]"; $pageno .= "$row[pageno]"; } ?> </select> <input type="hidden" name="cover" value="<?php echo $cover; ?>"> <input type="hidden" name="pageno" value="<?php echo $pageno; ?>">
  12. Yep so I guess your not going to look at my code and answer my question. Can someone look at the code and answer my original question? It would be greatly appreciated.
  13. Yes three columns of one row of data per selection. The form is involved because that's where they start. They fill out the form select a book name and everything with that book name needs to be added cover, page-no to table2. Yes they are hidden fields so the user can only see the name. I have text in the input in the loop for testing. I did this to see if it was working but name will be the only thing the user will see... the other variables will be hidden.
  14. ? I don't have a solution. What I'm trying to achieve with the code above is to post the variables you see in my first post and add them to the db. The variables you see are coming from a different table. All I need to do is grab those variables and post them. The hidden inputs are not populating with those variables. The loop is working < I see the variables but the inputs not populating.
  15. I have 2 tables. I'm trying post 3 variables in order to insert them in table2. The loop works I see the variables but when I use POST outside the loop I'm not getting the variables. I'm using a SELECT to get 3 variables from table1 which I'm getting those variables. I want to insert these variables in table2 but can't see the input value when looking at the source. The loop works. I get results in the loop but the input post echo's nothing. I've tried many different ways but can't seem to get it to work. Can someone help? <?php include('theconnection.php'); $con = mysqli_connect($host,$user,$pass,$dbName); if (!$con) { die('cannot connect: ' . mysqli_error($con)); } mysqli_select_db($con,"thebooks"); $result = mysqli_query($con,"SELECT * FROM books"); $result = mysqli_query($con,"SELECT b.id, b.name, b.cover, b.pageno FROM books"); while($row = mysqli_fetch_array($result)) { echo ("<input type='text' value='$row[name]' name='name' id='name'>"); echo ("<input type='text' value='$row[cover]' name='cover' id='cover'>"); echo ("<input type='text' value='$row[pageno]' name='pageno' id='pageno'>"); } ?> <input type="hidden" name="name" id="name" value="<?php echo "{$_POST['name']}"; ?>"> <input type="hidden" name="cover" id="cover" value="<?php echo "{$_POST['cover']}"; ?>"> <input type="hidden" name="pageno" id="pageno" value="<?php echo "{$_POST['pageno']}"; ?>">
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.