Jump to content

Kevin.Arvixe

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Everything posted by Kevin.Arvixe

  1. close.window is javascript. Output this with the buffer.
  2. Keep exploring the join statement though. Really, this is your answer. I wish i had a server infront of me, but I dont. SELECT theitemid, uitemid, location, image FROM uitems WHERE userid='$uid' AND location='1' LEFT JOIN items ON items.itemid = uitems.uitemid Try that?
  3. $query = "SELECT theitemid, uitemid, location, image FROM uitems LEFT JOIN items ON userid='$uid' AND location='1'"; $result = mysql_query($query); while($row = mysql_fetch_array($result)) { $itemid = $row['theitemid']; $uitemid = $row['uitemid']; $loc = $row['location']; echo "<a href=?act=view&uitemid=$uitemid><img src=items/$iimage></a><br>$iname"; } Looks like in your first query, you are doing this. I moved the echo to the top query and changed the query aswell... Im not incredibly strong w/ JOIN statements, and I dont have a MySQL box around to toy with, so you may get a syntax error, but essentially you will want to try out multiple JOIN statements to display the items image w/o having to query the database twice.
  4. foreach(); http://us.php.net/manual/en/control-structures.foreach.php Very well said You actually SAID the name of the function that will save you IN the post haha To elaborate... A foreach statement runs through each of the members of an array. Mysql returns results in an array. Happiness achieved.
  5. while($itemrow = @mysql_fetch_array($itemresult)) { $theiid = $itemrow['itemid']; $iname = $itemrow['name']; $iimage = $itemrow['image']; $idesc = $itemrow['description']; $itype = $itemrow['type']; $irarity = $itemrow['rarity']; echo "<a href=?act=view&uitemid=$uitemid><img src=items/$iimage></a><br>$iname"; } }
  6. Zend owns PHP, thats why you would see this. Do your PHP as you normally would, be happy and rejoice.
  7. Ok so do this... Login to your app, then access a page w/ the code you just showed me, that way the $_SESSION variable will be set.
  8. Im just going to throw this out there because you havent gotten any replies... MSSRS is not generally used w/ PHP. I think this is more of a question about MSSRS's SOAP API, which may be better suited for the MS forums.
  9. And this: Also, what is the expected outcome? What is actually being displayed? Also: while($itemrow = @mysql_fetch_array($itemresult)) { $theiid = $itemrow['itemid']; $iname = $itemrow['name']; $iimage = $itemrow['image']; $idesc = $itemrow['description']; $itype = $itemrow['type']; $irarity = $itemrow['rarity']; } echo "<a href=?act=view&uitemid=$uitemid><img src=items/$iimage></a><br>$iname"; } Exam this bit... The while statement goes and sets $iimage to $itemrow['image']; Then resets $iimage to the new $itemrow['image'] Then does it again... then again... until all of the rows are complete. AFTER $iimage is set to the final row, you do an echo. So this is only echo'ing the final row. Put your echo inside of the while statement (if you want each row to be echo'd)
  10. $email_query = mysql_real_escape_string($_SESSION['email_query']; SELECT needs_id, email_id, status, name, email FROM needs WHERE email_query = " . $email_query . " ORDER BY email_id DESC" 1. Whenever you use a WHERE clause, it has to be comparitive. So the variable has to be compared to a row in the database. 2. mysql_real_escape_string(); -- Please be nice to your server admins...
  11. And as far as this goes? $result = mysql_query($query) or die(mysql_error()); Also, what is the expected outcome? What is actually being displayed?
  12. Also, please be kind to your system admins.... mysql_real_escape_string(); $usernamet = mysql_real_escape_string($_POST["desired_username"]); $pass1 = mysql_real_escape_string($_POST["pass1"]); $pass2 = mysql_real_escape_string($_POST["pass2"]); $day = mysql_real_escape_string($_POST["day"]); $month = mysql_real_escape_string($_POST["date"]); $shopname = mysql_real_escape_string($_POST["shopname"]); $email = mysql_real_escape_string($_POST["email"]);
  13. Change this: $test = mysql_query("SELECT * FROM $table WHERE username = '$usernamet'");//this will see if the username exists in the table mysql_error(); To this: $test = mysql_query("SELECT * FROM $table WHERE username = '$usernamet'") or die (mysql_error());
  14. I dont think this will work... Can you echo the value of $_SESSION['HTTP_USER_AGENT'] and $_SERVER['HTTP_USER_AGENT'] for me? Or provide me with the line of code that sets the $_SESSION['HTTP_USER_AGENT']?
  15. arrays work great for this. $variable[0] = value $variable[1] = value2 or also you can do this... while($x=0; $x < 5; $x++) { foreach($_POST as $v) { $variable[$x] = $v; } } That puts all of your $_POST variables into the array $variable.... Granted thats sort of repetitive, but you get the idea right?
  16. Is $uid ever set? If this is all of the code, it does not appear so. Also, can you change one line for me: $result = mysql_query($query); to $result = mysql_query($query) or die(mysql_error()); And please provide me with the results
  17. To be honest, this is a bit of a task. I can give you some suggestions to look up though... Ajax/JQuery frameworks are great at dynamically changing things like Order totals. Look into this. For the form only e-mailing what is filled in, you could do something like... foreach ($_POST as $v) { if(strlen($v) != 0) { //include in the e-mail } else { //dont include } } If I am correct, that should essentially be your syntax.
  18. Response.clear in C# clears the header's... a flush() in PHP will OUTPUT the output buffer, causing the user to see its current content a ob_clean() in PHP will DESTROY what is in the output buffer, causing this to be destroyed and not see. Take your pick
  19. I assume that the company has security more or less locked down... But assuming they dont, you can use the javascript close.window method.
  20. Setup a cronjob (in Linux) or scheduled task (in Windows) to run a cleanup script. This is the easiest way.
  21. Use ftp_rawlist()
  22. Sorry I guess i should have explained a bit better. $row['login'] returns a username. In any event that worked for me, thank you very much! I'm sure I'll be back to ask more questions, but for now thanks and good luck. You can try this, but it sounds like you wanted something more like this: echo "<a href=\"page.php?user=".$row['login']."&pass=".$row['pass']."\">Click here to login</a>";
  23. Hi My name is Kevin. I am a Technical support associate for Arvixe Webhosting by day, and a PHP/C# Developer by night. Just here to assist some people, and expand my knowledge aswell. If you have any questions for me, always feel free to PM me or e-mail me.
  24. Thorpe is correct, you have not explained yourself. I assumed $row['login'] returned a username, as he assumed it returned a login URL. So if you can clarify this we can assist you better.
  25. These are called GET parameters. For the URL you provided, you would call the user name like this: $user = $_GET['username']; And $user would be this: admi1234423 I suggest cleaning the variables before putting them into the db... mysql_real_escape_string or addslashes will do the trick... http://us3.php.net/manual/en/function.mysql-real-escape-string.php http://us3.php.net/manual/en/function.addslashes.php
×
×
  • 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.