Jump to content

Search the Community

Showing results for tags 'rotate'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 2 results

  1. I am working on trying to get php code to take a record set from mysql table and rotate the records, so when you refresh the page, the first record would show at the top of the list, then record 2 and so on down the line. If you were a new person to come to the page, record 2 would show at the top of the list, then record 3 and down the line, and record 1 would now be at the bottom. I have a position column in the table and when the page loads it will update the position field of each record to be one less then it was before, so when the next person to come to the page, it will be up one spot in the table. My issue is that when the page gets refreshed to quickly or I have had it not finish updating the records and then there is multiple records with the same position number. I am looking to only have 9 records only for the example, so if Position is set to 1 it will be set to 9, if not it will take Position - 1. if(isset($_GET["page"])){ } else{ $sql = "SELECT ID,Name,Position FROM tableA ORDER BY Position DESC"; $result = $conn->query($sql); while ($row = $result->fetch_assoc()) { if($row["Position"] == 1){ $p = 9; } else{ $p = $row["Position"]-1; } $conn->query("UPDATE tableA SET Position = $p WHERE ID = $row[ID]"); } mysqli_free_result($result); } Am I going down the right path? It just seems like it will not work 100% of the time. Hopefully I explained what is going wrong fully and clearly. Thank in advance.
  2. Hi, New coder here! I'm making a php If loop that will post my image a set number of times (depending on user input in a text box), and I have that all figured out. However, I can't figure out how to rotate the image a random amount of degrees and have a random width/height for each image. Will rand generate new numbers for each time the image is echo-ed, or will it give the same number for all images? This is what I have: <?php function pic($picture) { $degree = rand(0,360) $num = rand(50,250) $total = 0; while ($total < $picture){ echo '<img src=blabla.gif width="$num" height="$num">'; $total = $total + 1; } } $picture = $_GET['input']; $a = pic($picture); } ?> Thanks in advance!
×
×
  • 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.