Jump to content

Muddy_Funster

Members
  • Posts

    3,372
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Muddy_Funster

  1. This kind of thing is commonly done by having a an aditional cross index table that draws from both the item and catagory table primary indexes. this allows the table to have multiple entries for each catagory and item which can the be refferenced through php page. so your PHP looks up the cross index table for the item code and reads all catagory entries that it is assigned to and then lists the item under those catagories. That's just the common way of doing it, I don't know how it works on your system, but I hope that gives you somewhere to start.
  2. could you post up your table structures so we have something to work with, oh and please don't use SELECT *, it's really not the best thing to do.
  3. just toss in a couple extra lines of code to pull the name out the database and send it in the mail like the ID: $qry = 'SELECT name from cart_1 WHERE <id_field> = ' .$_SESSION['cart']; $result = mysql_query($qry); $row = mysql_fetch_assoc($result); $_SESSION['name'] = $row['name']; Then just add this to your mail: $info = $_SESSION['cart'] . ' : ' . $_SESSION['name']; ... mail('[email protected]', 'Subject', $info, $headers);
  4. Yeah, can we see the full query? More often than not the problem lies just before the "syntax to use near" error string. Regardless it will make life much easier if we can see it in context. Also, please include the code where you build the string as well.
  5. I think INNER joins would be more applicable, and why are you bothering to alias a straight three table query where all the names are logical references already?
  6. read up on SELECT CONCAT() - that should get you what you need.
  7. you have neglected to actualy assign anything to $enabled thus it's never going to change with the values from the database.
  8. it's not picking up the file name properly because I gave you the wrong code. change the include statement to this: include_once 'admin_check.inc'; Sorry about that, It's been a while since I used an include statement like that - I should have checked it before I posted it.
  9. Guys - who told you that you to multiply by 100 when working out a percantage? Try (tot_gold/100)*mem_tot_gold
  10. what exactly do you meen by that? if you do printr($_SESSION['UserEmail']); nothing appears or that the page is just black, or that there is nothing that looks like an error being shown and everything apears to be ok? Also, could you please show where your session variables are being assigned, as this could be relevant is the information is being passed in wrongly (<- is that even a word? ). A short sample dataset from the table would help a lot too.
  11. If you want the article and announcement to match up with each other you will need to join them on a common field type. A sample dataset and your table structues would be a big help to us.
  12. I'll go ahead and assume that your refference to model_number is the same thing you called stock number at the top of the post. What you are looking for is a "Natural" Sort - something not inhearently supported in MySQL. Have a search about on that here in the forums and in google and you should find what you are looking for.
  13. Output formating is not done with SQL. It may help if you think of each language working like this: SQL - Data Storage & Retrieval --> PHP - Data Manipulation --> HTML + CSS - Data Preasentation. By telling your HTML to format the data in a two column table then you will get the results to apear as you described.
  14. post up your table info please.
  15. your not accessing your $_COOKIE[] array correctly, you need to wrap the array field in quotes.
  16. I'm sure there are clinics out there that can help with that (at least there should be) No, it's fairly easy, you just need to forget any access psudo-SQL you may have picked up and focus on the language that you want to use. To format things they way you want you'll need to learn how to format tables using html as well.
  17. ok, do you get the same error if you log in as a head and admin users? you can try if(isset($_SESSION['SESS_ADMIN'])) $loc = "http://" . _SERVER['PHP_HOST'] . "/admin/admin.php"; else $loc= "http://" . _SERVER['PHP_HOST'] . "/head/head.php"; if that doesn't help posting what the actual error is will.
  18. That won't help certainly, but I don't think there may be a small issue in here too :
  19. You would nest another IF condition within your code for successful login. Either compare the $_SESSION['username'] to a hard set value or to a result set takin from a database table of admin users. You could include an ELSEIF to your login contitions, but that would only effect the page that you are on. You would be best to hold the admin level check in another file altogether and call it into the script with an INCLUDE_ONCE(filename) on each page that you want to restrict access to. so for example, put the following line after your else{ include_once (admin_check.inc); then make a new file in the same directory as your current script page and save it as admin_check.inc finaly put the following code into the admin_check.inc file <?php if(!isset($name_check){ $name_check = $_SESSION['username']; } try { if ($name_check == 'admin'){ echo 'You are logged in as an administrator'; } else{ echo 'You are logged in as a user'; } } catch (Exeption $error){ die('Authentication level check failed with the following : '.$error->getMessage()); } ?> don't forget to save it again once the code is in and try it out. This code is untested and assumes that the administrator's username is 'admin'.
  20. Only way I know of is to close off folder access through port 80 on the webserver and only maintain access through port 443. There are probably other methods however
  21. if (what you tell us = A - what you expect it to do && B - what it actualy does && C - what the rest of the relevant code is) {we can help} else {you got no chance}
  22. Nope, it's all just html.
  23. have you tried running it through a WHILE (!feof($file)) instead?
  24. Why are you using sprintf to format the name and not the id part of the query string?
×
×
  • 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.