Jump to content

digitalgod

Members
  • Posts

    374
  • Joined

  • Last visited

    Never

Everything posted by digitalgod

  1. hey guys, I'm having problems using INNER JOIN was just wondering if someone could give me a hand. I have 2 tables, productsaffiliates and affiliates , I need to query the first table and be able to display it's info plus the info of the affiliate that's attached to that table... so productsaffiliates looks like this +-----------+--------------+------------+--------+----------+---------+ | id | productid | affiliateid | mysite | unitcost | unitprice | +-----------+--------------+------------+--------+----------+---------+ | 1 | 1 | 1 | 0 | 160 | 180 | +-----------+--------------+------------+--------+----------+---------+ and affiliates looks like this +-----------+--------------+------------+-----------+------------+ | id | username | password | firstname | lastname | +-----------+--------------+------------+-----------+------------+ | 1 | test | test123 | John | Smith | +-----------+--------------+------------+-----------+------------+ so when I do SELECT DISTINCT productsaffiliates.id, productid, affiliateid, unitcost, unitprice, mysite FROM productsaffiliates INNER JOIN affiliates ON productsaffiliates.affiliateid = affiliates.id WHERE productsaffiliates.productid =1 if I echo $prereq["firstname"] I get an undefined index but if I echo $prereq["unitcost"] I do get the 160 what am I doing wrong?
  2. your while statement isn't closed.. just add : } before your first break oh and you also forgot to close your switch
  3. well it's a private server that only employees would have access to but I see your point. There has to be something though....
  4. your form is using the post method so just replace $_GET['name'] by $_POST['name']
  5. well what about with exec() ??
  6. hey guys, I was just wondering if there was any way of having php make a receipt printer print..?
  7. well it's a PO number from an invoice, there are 3 types of invoices and each type starts with it's own 3 letters followed by the digits.. Thanks Koobi it works perfectly
  8. yup I'm certain that it will always be 4 digits, thanks I'll give it a shot!
  9. Hey guys, I need to grab a string from a db that looks like this : WLK0001 and simply add +1 to it, it has to stay in the same format... any suggestions?
  10. hey guys, I'm currently storing the date and time in a table like so 20070406145935 and I would like to output it like 06/05/2007. To do that right now I'm doing this and it works perfectly CONCAT_WS( '/', SUBSTRING(tickets.timestamp, 7,2), SUBSTRING(tickets.timestamp, 5,2), SUBSTRING(tickets.timestamp, 1,4)) but I was wondering if t here was a better way of doing this though...
  11. thanks brooksh but like I said I already made my own password generator, just trying to get it to generate everytime a button is clicked
  12. that's what I thought, thanks linuxdream, I'll try to google for some AJAX examples.
  13. Hey guys, not sure if this is in the right forum or not but I was wondering how can I make a password generator using php and javacript so that whenever a button is clicked it generates a random password in a text box. I've already done the password generator code. When I click on the button it generates a password but if I click it again it won't generate a different code. So is there a way to have it generate a different password each time? Right now when I click on the button it will call the javascript function to change the text in the input box to echo rand_pass(); like so <input id="password" name="password" type="text" size="71" maxlength="128" style="margin-top:2px;" tabindex="26"/> <input name="rand_pass" id="rand_pass" type="button" value="generate" onClick="generate( 'password', '<?php echo rand_pass(); ?>' );" class="Buttons">
  14. thanks for the clarification wildteen
  15. alright thanks guys. For some reason I always thought that if a variable was empty it would mean that it's NULL
  16. hey guys, why does [code=php:0] if (isset($_FILES['file1'])) { [/code] always return true, so the if statement is always processed, even though my file field (file1) is empty?? It's just a basic form that pulls info from the db and let's a user modify that info. I just can't understand why is it that when I [code=php:0]echo isset($_FILES{'file1'])[/code] it returns 1 even though the field is empty.... any ideas?
  17. a cron job has to be done by the server, if you have cpanel there's a link just for that where you can tell the server to run a file and at what interval
  18. thanks alpine, it works perfectly now. I knew it had something to do with the php version.
  19. Alpine I'm getting this error with your line Warning: parse_url() expects exactly 1 parameter, 2 given test.php on line 2
  20. I read a little and noticed that I would have to go and change all of the links in my script... which would be way too much work and almost impossible at this point
  21. thanks [b]Orio[/b], I'll take a look at that, quick question though, I only want the members section to work like that, if I use mod_rewrite do I have to change the entire script or just the part that I need? [b]Crayon Violent[/b], I already know how to do that, I just need the digitalgod part, I want to be able to display a user's profile that way. So someone can go to members.php?crayonviolent and see your profile. [b]Alpine [/b] what would be the difference between that and using mod_rewrite? I haven't read up on mod_rewrite yet so I don't know much about it
  22. just wondering how could I use $_GET to get whatever value that's after the ? so something like index.php?digitalgod I need to get the digitalgod part
  23. yeah they do, I just left all those fields blank for testing purposes. And anyways whenever there's a blank in a row, that row doesn't get displayed to the user
  24. Hi Thorpe here's the ouput SQL = INSERT INTO mtl_news (headline,content,thumb,website1,website2,website3,desc1,desc2,desc3,`date`, when, `where`, `type`) VALUES ('we\'re testing','this is just a test','cercle.jpg','','','','','','','2006-11-01','','','both') I don't understand why it doesn't work. The table exists and all the rows as well
×
×
  • 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.