Jump to content

Muddy_Funster

Members
  • Posts

    3,372
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Muddy_Funster

  1. "UPDATE xcart_pricing p INNER JOIN TbItemInventory pp ON p.productid = pp.XcartID SET p.price = pp.SalesPrice WHERE p.membershipid = 1 "
  2. Technicaly we do...but we also expect payment up front
  3. change the word LEFT in the original query to INNER. Your select query should look like SELECT * FROM TbItemInventory INNER JOIN xcart_pricing ON TbItemInventory.XcartID = xcart_pricing.productid ;
  4. maybe not, LEFT and RIGHT joins include null value matches from one table or another...INNER joins only affect fields that match on both sides of the join.
  5. how about reading my last post? I mentioned not using {} arround $username, as well as not entering empty values and the use of the CURRENT_DATETIME() One out of three aitn bad... Anyway, ignoring the fact that you ignored most of my last suggestions to improve your code, lets focus on the fix. Find this piece of your code: while ($result = mysql_fetch_array($queried)) { $menu .= ' <option value="' . $result['id'] . '">' . $result['username'] . '</option>'; } replace with: while ($result = mysql_fetch_array($queried)) { $menu .= "<option value=\"{$result['username']}\">{$result['username']}</option>"; } Next Find: $sql1 = "SELECT username from mailbox where username = '$_POST[username]'"; And change to: $sql1 = "SELECT username from mailbox where username = '{$_POST['username']}'"; I'm not even going back to what's wrong with your $sql2 line. Interested how this is ever supposed to make a new mailbox if the only choices on input are from a dropdown list of already existing mailboxes...
  6. have you tried running it as an INNER JOIN?
  7. yes, you would need to change the information for $host, $name and $password to reflect your hosted database and an account on that. then run the page to create the table on that server.
  8. why not put them all on the same page and call the sql you want dependant on the $_GET[] variable from the url. you could create a function for each, or use an array - or if your feeling really keen a mixture of both.
  9. I'm just trying to help you here, I can't do that if you won't work with me. is a permission problem, I'm trying to break it down to find out where, nothing to say you can't change it all back once it's fixed. Do you really have a database account that has the username "nobody" with no password?
  10. For that kind of layout you would be better using CSS. I don't think that you can nest tables within table cells (never tried) so I don't see you getting the layout that you are looking for without CSS. if you just want to use your current table and add another product listing on the same row change the contents of the while loop to include an if statement that will check and set a second product on the same row before droping down to the next we can use that little $i variable that's just hanging about at the top of the loop: $i = 0; echo = "<table><tr>"; while ($row = mysql_fetch_array($result_set)) { echo"<td>{$row['product_id']}</td><td>{$row['product_title']}</td><td>{$row['product_Description']}</td><td>{$row['product_price']}</td>"; if ($i >= 1){echo "</tr><tr>"; $i = 0;}else{$i = $i++;} } echo "</tr></table>";
  11. I only count 163 lines in the code that's posted, did you trim it or are you perhaps posting the wrong page?
  12. right, so there is a problem with connecting to the database with the information used in the wow.php file. lets simplify it down and see what we get: <?PHP //New Connection atempt for wow databse $host = "localhost"; //change this if the MySQL database is on a different server from this php script $name = "username"; // change this to the username of an account on the db server that has permission to perform the actions that you are planning $password = "password"; // the password for the account username used above $db = "database"; // the database that you are going to be using - this is NOT the same as table name $con = mysql_connect($host, $name, $password) or die("ERROR - unable to connexct to the server. Server reported the following:<br><br>".mysql_error()); $db = mysql_select_db($db, $con) or die("ERROR - Unable to change database. Server reported the following:<br><br>".mysql_error()); ?> change your query to: $uid= $user->data['user_id']; // pull the user id into something a little easier to work with $sql = "SELECT * FROM accounts WHERE forum_acc= '$uid'"; // build the query string - there is a reason for this! $result = mysql_query($sql) or die("ERROR - Query Fialed while running:<br>-------------------<br>$sql<br>---------------------<br>Server Responeded with the following:<br><br>".mysql_error()); $row = mysql_fetch_array($result); Make those changes and let me know how you get on. If it's still erroring we should at least get a bit more info back.
  13. You do not have a value for the variables $product_id, $product_title, $product_description or $product_price! razormedia is eather trying to mess with you or seriously not qualified to be posting help on this thread. copy/paste this and see what you get: <?php require_once("functions.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> td { border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #30C; border-right-color: #30C; border-bottom-color: #30C; border-left-color: #30C; } </style> </head> <body> <?php navBar(); echo "<form action=\"\" method=\"post\" name=\"catalog\">"; DatabaseConnection(); $query = "SELECT * FROM treats"; $result_set = mysql_query($query) or die(mysql_error()); $i = 0; echo = "<table>"; while ($row = mysql_fetch_array($result_set)) { echo"<tr><td>{$row['product_id']}</td><td>{$row['product_title']}</td><td>{$row['product_Description']}</td><td>{$row['product_price']}</td></tr>"; } echo "</table>"; ?> </form> </body> </html> also make sure that that random upper case D in product_description is actualy ment to be upper case, or else it's going to be a problem.
  14. yip I do either your just not listening or your not properly updating your question. Have you tried what PFMaBiSmAd suggested? if so what is your new code and what is the current error? If not, why not?
  15. I'm thinking along the lines of: SELECT * from recurring where ((member_id IN (SELECT member_id FROM recurring WHERE product_id = 87)) AND (member_id IN (SELECT member_id FROM recurring WHERE product_id = 1))) GROUP BY member_id ORDER BY member_id LIMIT 10
  16. I take it the problem with your current query is that it's returning an OR dataset?
  17. key info at the top of that page is You enter the affore mentioned SQL code into the SQL section of your MySQL admin pages. This will create your table for you to access using your php script. If you want PHP to do it you will need to build it into a string and execute it using mysql_query. <?php // make a new page to create table and put this code into it $host = "localhost"; // as you are running the MySQL database on the same machine that you are running the script on $name = "dbName"; // change this to the name of a database user account that has permision to create tables $password = "dbPassword"; // the password for the databse username used in the line above $con = mysql_connect($host, $name, $password) or die ("ERROR - could not connect to the server. Server returned the following error message:<br><br>".mysql_error()); $db = "your_database_name"; // this is the database that you will be using within your server - this is NOT the table name $db = mysql_select_db($db, $con) or die ("ERROR - Could not switch to chosen databse. Server returned the following error:<br><br>".mysql_error()); $sql = "CREATE TABLE `guestbook`.`guest` (". "`Guest Number` INT( 4 ) NULL DEFAULT NULL AUTO_INCREMENT PRIMARY KEY ,". "`Name` VARCHAR( 70 ) NULL DEFAULT NULL ,". "`Message` VARCHAR( 200 ) NULL DEFAULT NULL ,". "`Posted` TIMESTAMP NULL DEFAULT NULL ". ") ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_bin"; $qry = mysql_query($sql) or die ("ERROR - Unable to create table. Server responded with:<br><br>".mysql_error()); echo "Table \"guestbook\" has now been created"; exit; ?>
  18. This: <?php CREATE TABLE `guestbook`.`guest` ( `Guest Number` INT( 4 ) NULL DEFAULT NULL AUTO_INCREMENT PRIMARY KEY , `Name` VARCHAR( 70 ) NULL DEFAULT NULL , `Message` VARCHAR( 200 ) NULL DEFAULT NULL , `Posted` TIMESTAMP NULL DEFAULT NULL ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_bin; is NOT php code. This is SQL and will need to be run against your database, php can not parse SQL code, it's just not what it does. Lets take this back to the start. Where are you setting all this up? hosting or local server?
  19. how about changing it to fopen()?
  20. I don't undertand, if you have already created the database what are you asking about the PHP?
  21. you could put it in a loop: $qry = "SHOW COLUMS FROM export"; $loop_result = mysql_query($sql) or die (mysql_error()); $c= 0; while ($loop_row = mysql_fetch_array($loop_result)){ $field = $loop_row['Field']; $sql = "UPDATE export SET $field = (REPLACE(department, '\"',' '))"; $update = mysql_query($sql) or die (mysql_error()); $c = $c++; } if($c >= 1){ echo "$c Fileds have been successfuly reformated"; } else{ echo "Operation did not update any rows"; }
  22. AJAX does require java enable browsing, bo if that's not a condition that you can set with the client machines then it's not going to be an option. Best I can suggest is that you force the browsers download manager to take charge of the file transfer, or at the extem end, program something specific that will manage downloads in a local language like C#/++ / pascal / VB and have the end users install and use that for the files. As for the object problem, you could simply have the tags published to the page by PHP only on event of an end user being validated.
  23. You only have 1 slash too many, but you need an extra set of parenthesis around the whole REPLACE statement: $result = mysql_query("UPDATE export SET department = (REPLACE(department, '\"',' '))", $connection);
  24. if your trying to get to a client machine then PHP doesn't strike me as the best option to take, I'd look at JAVAScript or AJAX options for the big files, and use <object> containers in the HTML for the likes of PDF Files, which will allow the users to download the files or view them live using existing commercial plugins.
  25. If you're just trying to get a file from a remote server onto your PHP webserver, I would go with ftp if you can.
×
×
  • 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.