Jump to content

darga333

Members
  • Posts

    53
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

darga333's Achievements

Member

Member (2/5)

0

Reputation

  1. Hey Barand, do you know of a way with the older version of mysql? I am going to upgrade mysql but at a later date. I did several searches online and tried to come up with a solution before replying back to this topic. I have another question also. It said that i was tryign to do was a multiple table update when infact I am just updating 1 table. Maybe you might know why that is?
  2. This is what the screen says: Welcome to phpMyAdmin 2.5.6 MySQL 3.23.56
  3. it still gives me the same error I dont understand what I could be doing wrong I have it set up exactly how you are saying UPDATE members,discount SET members.sImagePath=discount.sImagePath WHERE members.user_id = discount.iMemberId i am trying to set members.sImagePath = discount.sImagePath ... could it possibly be because I set members.sImagePath as null when i created the column?
  4. Hey for some reason it is giving me the following error: #1064 - You have an error in your SQL syntax near ' discount SET members.sImagePath = 'discount.sImagePath' WHERE memb' at line 1 UPDATE members,discount SET members.sImagePath='discount.sImagePath' WHERE members.user_id = discount.iMemberId does anyone know what i am doing wrong?
  5. Hi I am trying to set t1.sImagePath=t2.sImagePath and it is not working for some reason This code selects what I need [code]SELECT t1.sImagePath,t2.sImagePath FROM members t1, discount t2 WHERE t1.bBusiness = 1 AND t1.user_id = t2.iMemberId AND t2.sActive = 1 GROUP BY t1.user_id[/code] does anyone know how to do that?
  6. for instance.. you have a file name that has an & in it and you try downloading it you cant find the file cause it stops at getWebsiteUp, it cant seem to get the & because the address bar processes &'s differnetly filedownnload.php?action=download&filename=getWebsiteUp&ampRunning.doc
  7. I apologize for that but I am looking for a solution without Inner Joins and List variables. But thanks for your earlier response, it was much appreciated. Just a bit too confusing for me
  8. can you narrow down your problem to just a few lines of code?
  9. I am having a problem displaying the result of my sql statement in groups. It needs to spit out the first category, then the first business name in that category, then all of the Headlines for that business... then it needs to just loop and do it again for each business in that same category.. and then it needs to move to the next category and repeat the process. I am only using 1 SQL statement that is relatively simple [code]$sql_1  = "SELECT t1.sHeadlines,t2.sName,t3.sBusinessname FROM ucfdiscount t1,ucfdiscountcategory t2,ucfmembers t3 WHERE t3.user_id = t1.iMemberId AND t1.iDisCategoryId = t2.idiscategoryid ORDER BY t2.sName, t3.sBusinessname, t1.sHeadlines ASC"; $result_1 = mysql_query($sql_1); $row_1 = mysql_fetch_array($result_1); $num33 = mysql_num_rows($result_1); if ($num33 > 0)  {                $message =  $row_1['sName'];           $message.=  $row_1['sBusinessname'];           $message.=  $row_1['sHeadlines']; }[/code] I know I am missing the if statements inside the bracket that will allow me to do this. Will someone please help me figure this out. The logic is: For each Category display category For each Business Name display business name For each Headline Display headline Do i just need 3 different for each statements? Thank you so much for helping me figure this out!
  10. yeah how it works is a "Print" link will be displayed.. that print link will make the print.php page pop up it will pass a variable print = 1 then i will run the SQL statement and update the database then it will pop up the print dialog box and then it will immediately close the window.. The question: Once the print dialog box pops up does it automatically know to print what was on the page that the Print button was on (print.php) even if i close the window before the person clicks to actually print the document?? or do you have to have the window open, and then the person prints it and only after it is printed, then you can close the window? I need to make sure that the person is actually going to print what was on the print.php page.
  11. would I close the window as soon as the print dialog pops up? the part about this whole thing that i dont understand is that the print button has to be attached to an onClick but in that onclick it is ganna be javascript.. how can i go from javascript to php to update the database? bcause javascript is client side and php is server side.. so when they click print do i have to have it submit to the same page first, then inside of the code... if it has been submitted, then do the php first.. and then call the javascript to popup the print window and close the window in that order?
  12. How do you make the window close immediately after you click "Print" but still allow it to print the page that the "Print" button was on and also allow it to update the database with print = 1. The order of operations would be: 1. Click Print 2. Run SQL Query $sql = "UPDATE print SET print=1 WHERE user_id='$user_id'"; $result = mysql_query($sql); 3. Print Dialog Pop Up 4. Immediately close window Does anyone know how to do this?
  13. I am not a fan of large code posts. I apologize for that. I understand the main thing we need to look at here are the two loops.
  14. [!--quoteo(post=372172:date=May 7 2006, 10:42 PM:name=shams)--][div class=\'quotetop\']QUOTE(shams @ May 7 2006, 10:42 PM) [snapback]372172[/snapback][/div][div class=\'quotemain\'][!--quotec--] hi, these are php codes to update the mysql enteries, when i run them the final updated.php message is "Welcome Done" but when i check the mysql table home it is not updated, this is the /var/log/httpd/error_log message: this is the update.php: [code] <html> <body> <?php $id = $_POST['id']; $name = $_POST['name']; mysql_connect("localhost", "root") or die(mysql_error()); mysql_select_db("mydb") or die(mysql_error()); $query = "SELECT * FROM home WHERE id='$id' or name='$name'"; $result = mysql_query($query); $num = mysql_numrows($result); $i=0; while ($i < $num) { $id = mysql_result($result,$i,"id"); $name = mysql_result($result,$i,"name"); $address = mysql_result($result,$i,"address"); ?> [/code] [!--html--][div class=\'htmltop\']HTML[/div][div class=\'htmlmain\'][!--html1--]<[color=blue]form action[/color]="[color=orange]updated.php[/color]" method="[color=orange]POST[/color]"> <[color=blue]input type[/color]="[color=orange]hidden[/color]" name="[color=orange]ud_id[/color]" value="[color=orange]<? echo $id; ?>[/color]"> Name: <[color=blue]input type[/color]="[color=orange]text[/color]" name="[color=orange]ud_name[/color]" value="[color=orange]<? echo $name; ?>[/color]"><[color=blue]br[/color]> Address: <[color=blue]input type[/color]="[color=orange]text[/color]" name="[color=orange]ud_address[/color]" value="[color=orange]<? echo $address; ?>[/color]"><[color=blue]br[/color]> <[color=blue]input type[/color]="[color=orange]submit[/color]" value="[color=orange]UPDATE[/color]"> <[color=blue]/form[/color]> <?php ++$i; } ?> <[color=blue]/body[/color]> <[color=blue]/html[/color]>[!--html2--][/div][!--html3--] and this is the updated.php: [code] <?php $id = $_POST['ud_id']; $name = $_POST['ud_name']; $address = $_POST['ud_address']; mysql_connect("localhost", "root") or die(mysql_error()); mysql_select_db("mydb") or die(mysql_error()); $query = "UPDATE home SET name='$ud_name', address='$ud_address' WHERE id='$ud_id'"; $rt = mysql_query($query); if($rt) { echo "Welcome Done";} else { echo "sorry";} ?> [/code] please any one can help? [/quote] change this $query = "UPDATE home SET name='$ud_name', address='$ud_address' WHERE id='$ud_id'"; to this $query = "UPDATE home SET name='$name', address='$address' WHERE id='$id'"; :) you can either do that or you can set the variables equal to the $_GET['ud_name'], $_GET['ud_address'], and $_GET['ud_id'] respectively
×
×
  • 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.