Jump to content

RobertSubnet

Members
  • Posts

    34
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

RobertSubnet's Achievements

Member

Member (2/5)

0

Reputation

  1. Well I am not sure how to display the output from show open tables using PHP but I did use a sleep() just after locking the tables from PHP. Checking the command line and sure enough the table was locked. So Kicken it looks like you were correct once the script ended the lock released. Thank you all for your help!!
  2. Kicken I had not considered that. I am just running the script and then checking on a command line to see if the table is locked with a show open tables. Is there someway to confirm that the table was locked when the script ran? Thanks.
  3. I think I have finally found the answer: skip_locking or in this case skip_external_locking is set to on. Now I am trying to figure out how to enable external locking; my my.cnf file has the following: [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql enable-locking external-locking Save and restart the mysqld service and skip_external_locking is still set to on. Any ideas on why the my.cnf is not turning off the skip_external_locking? Thanks.
  4. Hello all. I am attempting to use PHP to lock a MySQL table that uses a myisam engine. The code I am using is as follows: mysql_query("LOCK TABLES stuff4sale WRITE;"); But when executing a show open tables from the command line I see that the table does not get locked. I can lock and unlock the table just fine from the command line but not when using PHP. This should be pretty simple but obviously I am missing something. Prior to running the PHP I have confirmed a working connection to the database. What am I missing? Thank you for your time and comments.
  5. Yes. If there is a simpler way of doing it, I would really appreciate your telling me. Thanks.
  6. Hello all. I am using the following bit of code to resize a jpg image and then display it with and img tag. The function works just fine to resize the picture. But the problem I am having is saving the image in its reduced size. I have tried imagejpeg to create a new, resized image, but that did not work. My server is using GD v.2.0.28. <? function setImageSize($image_file) { $maxSize = 155; // set this varible to max width or height $image_size = getimagesize($image_file,&$image_info); $width = $image_size[0]; $height = $image_size[1]; if($width > $maxSize || $height > $maxSize) { if($width > $maxSize) { $z = $width; $i = 0; while($z > $maxSize) { --$z; ++$i; } $imgSizeArray[0] = $z; $imgSizeArray[1] = $height - ($height * ($i / $width)); } else { $z = $height; $i = 0; while($z > $maxSize) { --$z; ++$i; } $imgSizeArray[0] = $width - ($width * ($i / $height)); $imgSizeArray[1] = $z; } } else { $imgSizeArray[0] = $width; $imgSizeArray[1] = $height; } return $imgSizeArray; } $imgSize = setImageSize("archer.jpg"); ?> <br/> <img src="archer.jpg" width="<? echo $imgSize[0];?>" height="<? echo $imgSize[1];?>" /> Any suggestions about what I am missing to save the returned file in its reduced size woudl be much appreciated. Thanks! ~Robert
  7. Hello all. Hopefully this is an easy one. I am trying to play a video clip using the following code: <embed src = "my_clip.mp4" WIDTH = 292 HEIGHT = 290 autostart = "false" controller = TRUE> The clip plays just fine in IE and Firefox. But the controll buttons, Play, Pause, etc., are not displayed. There is only a black strip where the control buttons should be. What do I need to add to get the control buttons? They are present when playing a WMF or AVI. Thanks!
  8. Thanks Nightslyr and Monadoxin! I will give those a try. ~Robert
  9. Hello all. I hope this is the right forum for this question. I would like to have a pop-up description for a picture when the user moves their mouse pointer over the picture. The code I had in mind would select the path to my pictures and their description stored in MySQL. Then use a while loop to retrieve the image paths. Something like this: <?PHP $query="select picture_path, description from my_table where picture = 'funny'"; mysql_query($query); while (mysql_query) { $picture_path = $row['picture_path']; $description = $row['description']; ?> <img src='<?php echo "$picture_path"; ?> onmouseover="<p class="my_class"><?php echo "$description"; ?></p>" /> <?php echo '<br>'; //close while loop } ?> Would something like this work? Is there a better way to implement this? Thank you for your suggestions.
  10. Wildteen: Thanks! ~Robert
  11. Hello all. I am trying to use a while loop to populate a table with pictures and a short description under the pictures. It should look something like this: pic1 pic2 pic3 text text text pic4 pic5 pic6 text text text etc. I am using PHP and MySQL to get the pictures and text data. The tricky part is getting the table populated correctly. What I currently have looks like this: pic1 pic1 pic1 text text text pic2 pic2 pic2 text text text etc. I understand why the first row is all the same picture. What I don't know is how to get pic1, pic2, pic3 on the first row. Here is my code: while ($row = mysql_fetch_array($gallery_query_result)) { $photo1 = $row['photo1']; echo "<table>"; echo "<tr><td>"; echo "<img src = $photo1 /><br/>"; echo "short description"; echo "</td><td>"; echo "<img src = $photo1 /><br/>"; echo "short description"; echo "</td><td>"; echo "<img src = $photo1 /><br/>"; echo "short description"; echo "</td></tr>"; echo "</table>"; //close while loop } Is a table not the best way to output the pictures and text? Any suggestions would be much appreciated. Thanks!!
  12. Greetings all. I have a web site that uses long option lists and switch cases. Both of these use numerical sequences. When I make a change, re-ordering is a very long and tedious process. For example: 1 => apple 2 => pear 3 => grape 4 => banana ------------- Insert orange in the #2 spot 1 => apple 2 => orange 3 => pear 4 => grape 5 => banana Here the re-ordering is easy. But in my scripts, I have close to 200 options/switch cases. What I am wondering is can I use str_replace() combined with a while loop to automate the process? With the subject (input file) being along the lines of: $subject = './myfile.php'; Thanks, ~Robert
  13. Hello all. I could not find a more appropriate forum for this question, so mod please move the topic if necessary. I am wondering, if I were to hire a php developer to add pagination to about a dozen different scripts that I have, about what amount would they charge? Or to put it another way, what would be a fair amount to pay this person to add the pagination? Thanks, ~Robert PS: Since it will probably be asked: yes, I have tried to do it myself. But I am not able to get it working properly. And due to to confidentiality issues, I am not able to post the scripts. So I am considering contracting someone to do it.
  14. Barand: Thanks! I rewrote the query the way you suggested and it still did not work. I then checked the value of $seller_name and it came up as a MySQL Resource ID. After running the $seller_name query through mysql_fetch_assoc, everything else worked the way it should. Thanks again for your help! ~Robert
  15. Greetings all. For some reason I cannot get the bit of code below to work. What it is supposed to do is 1. read the current number of positive reviews and then increase the number of positive reviews by 1. The $query62 is not updating the users table but I cannot find a fault in the coding. The MySQL field type is an int(7) unsigned default '0' not null I have the error reporting set to E_ALL and PHP is not complaining. Just for grins, I had php display the values of the following variables: the value of row is: the value of fixed pos is: the value of increase pos is: 1 So $increase_pos has a value. I don't understand why it is not updating my users table with that value. Any suggestions would be much appreciated. Thanks! Switch ($review) { case "positive": $_one = 1; /*Get the current number of positive (pos) reviews and increase by one. */ $query_pos = "Select positive_sales from users where login_name = '$seller_name'"; $result_pos = mysql_query($query_pos); $row = mysql_fetch_assoc($result_pos); $fixed_pos = $row['positive_sales']; $increase_pos = ($fixed_pos + $_one); $query62 = "update users set positive_sales = '$increase_pos' where login_name = '$seller_name'"; $result62 = mysql_query($query62); break;
×
×
  • 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.