Jump to content

krisw44

Members
  • Posts

    18
  • Joined

  • Last visited

Everything posted by krisw44

  1. If the selected option is there at all it will select the item. Set it up so that if $picked == true then it adds the selected option to that tag. If not have it leave the option out.
  2. Yea, that would definitely help with the whole sorting process. If you want the symbols then have them added in the html/php instead of writing them to the database
  3. Can you show us the structure of your tables? Is the price field a string?
  4. I just found another issue. You are using the same variable name for the query as you are for the result.
  5. Give this a try: SELECT * FROM products LEFT JOIN options ON products.id = options.id WHERE products.categoryid = '4' ORDER BY options.price That should link your tables, only return the results in the category that you want, and then sort it accordingly. Add a conditional to your code to determine asc or dec
  6. Go into the database, phpmyadmin or whatever it is, and run the query directly with a value for $id that you know should work. When you get that error usually it means that mysql has returned something that isn't a query result so php doesn't know how to handle it.
  7. First thing that comes to mind is to split the search term that the user types on the space character. Then, search the database for each of the terms separately. So instead of searching for "new york city" you instead search for "new", "york", and "city". From this you can eliminate duplicates and possibly rank them based on how many times each word shows up. Maybe require at least 50% of the words to match to cut out words like "in" or "the" from flooding the results. Hopefully this is helpful, it actually gave me an idea for my own search feature, so thank you.
  8. You could do it with a 'for' loop or a 'foreach' loop. I think it is more a matter of preference and what you are going to do with the data. I tend to use 'for' loops. for(i=0; i < count($exampleMultidmArr); i++) { for(j=0; j < count($exampleMultidmArr[i]); j++) { echo $exampleMultidmArr[i][j]; } } With this method you can do additional things with the data since you are determining the exact position of each item. Hope this helps.
  9. I don't know if i understand you correctly, but this is what I think you want to do. You have a client side application that is hitting your server. You want to make sure that the client has the newest version of your files. My suggestion would be to create a database on your site with a list of pages and their current version. Then at the top of each necessary page have it check with the server to see if it is the newest version. Hope this helps.
  10. I think the problem is that you are declaring the function for "submitform" inside of the while loop. So there is a function name conflict when you have more than one folder. The form is the same name every time too... You should probably increment the form name and them pass the increment value to the function so that it know which form to pull the data from.
  11. You're missing a semi-colon in your user_exists() function. function user_exists($username) { $username = sanitize($username); $query = mysql_query("SELECT COUNT (`id`) FROM `members` WHERE `username` = '$username'"); //<-- added semi-colon return (mysql_result($query, 0) == 1) ? true : false; } Not sure if this fixes the error though.
  12. It looks like you just need to remove AND timg.image_type = 'profile' from the second to last line. Then it should select all of the images, no matter the type.
  13. I can see the problem with your code as it is written. The correct code would be: <a href="catbrowser.php?qcatid=<?php echo $value['gcategoryid']; ?>" class="backToLink"> <?php echo $value['catname']; ?> </a> That said, without knowing the context of the variables and such I have no idea if it will do what you want it to do.
  14. Change your first query to this and post the result: $query = "SELECT username FROM members WHERE username = '$username'"; echo $query; $result = mysql_query($query);
  15. I like that idea Maniac. Going to go give it a shot. I'm templated before, not sure why i didn't think to do it here. Appreciate the help and idea bouncing.
  16. It is a workbook. User A stores the data and user B can view it when they log into a resource panel. User A can also log back in to view/change their answers at any time or see if they are correct once User B has corrected it.
  17. Jessica: I understand the issues with it, but not sure how else to retrieve and load the data without having to manually build each page. DarkerAngel: Yes, the main page is a .php page. It process all of the main php requests properly, just not the ones being called within the second level. ManiacDan: I'll take a look at those snippets.
  18. Ok, so I have a site that I am building, with a content manager. In the content manager i am putting some php code to display in the page. Here is the holder for the page content: <div id="contentholder" class="yesprint"> <div id="innercontent"> <?php echo $row['content']; ?> </div> </div> Here is the code that is getting loaded as $row['content']: <form name="qform" id="qform"> <input type="text" name="p19q2" value="<?php echo $valarr['p19q2']; ?>"/><br/> <input type="text" name="p19q3" value="<?php echo $valarr['p19q3']; ?>"/><br/> <input type="text" name="p19q4" value="<?php echo $valarr['p19q4']; ?>"/><br/> <input type="radio" name="p19q5" value="123" <?php if($valarr['p19q5'] == '123'){ echo 'checked="checked"'; } ?>/>123 <input type="radio" name="p19q5" value="456" <?php if($valarr['p19q5'] == '456'){ echo 'checked="checked"'; } ?>/>456<br/> <input type="text" name="p19q6" value="<?php echo $valarr['p19q6']; ?>"/><br/> <textarea type="textarea" cols="30" name="p19q7" rows="7"><?php echo $valarr['p19q7']; ?></textarea><br/> </form> <button type="button" onclick="saveXML()">Save</button> It is currently showing the php code in the value tags as the value for each input, instead of processing the php. If I copy the source code and run it alone it works fine though. Here is the combined source snippet: <div id="contentholder" class="yesprint"> <div id="innercontent"> <form name="qform" id="qform"> <input type="text" name="p19q2" value="<?php echo $valarr['p19q2']; ?>"/><br/> <input type="text" name="p19q3" value="<?php echo $valarr['p19q3']; ?>"/><br/> <input type="text" name="p19q4" value="<?php echo $valarr['p19q4']; ?>"/><br/> <input type="radio" name="p19q5" value="123" <?php if($valarr['p19q5'] == '123'){ echo 'checked="checked"'; } ?>/>123 <input type="radio" name="p19q5" value="456" <?php if($valarr['p19q5'] == '456'){ echo 'checked="checked"'; } ?>/>456<br/> <input type="text" name="p19q6" value="<?php echo $valarr['p19q6']; ?>"/><br/> <textarea type="textarea" cols="30" name="p19q7" rows="7"><?php echo $valarr['p19q7']; ?></textarea><br/> </form> <button type="button" onclick="saveXML()">Save</button> </div> </div> Any thoughts or suggestions on this would be much appreciated.
×
×
  • 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.