Jump to content

Search the Community

Showing results for tags 'mysql php'.



More search options

  • 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 (Dreamweaver, Zend, 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 5 results

  1. I'm creating a report page and can't figure out how to retrieve multiple rows from a table and display them in html. There are 5 data elements in each row and I'm thinking that using a form in the html might be the best way as I'm totally ignorant about tables in html. I'm a newbie to php and can't figure out how to accomplish this. Here's the code that I have so far: <?php $filename = NULL; session_start(); // start of script every time. // setup a path for all of your canned php scripts $php_scripts = '../php/'; // a folder above the web accessible tree // load the pdo connection module require $php_scripts . 'PDO_Connection_Select.php'; //******************************* // Begin the script here // Connect to the database if (!$con = PDOConnect("foxclone")): { echo "Failed to connect to database" ; exit; } else: { $sql = 'SELECT COUNT(IP_ADDRESS) FROM download WHERE FILENAME IS NOT NULL'; $sql1 = 'Update download t2, ip_lookup t1 set t2.country = t1.country, t2.area = t1.area, t2.city = t1.city where ((t2.IP_ADDRESS) = (t1.start_ip) OR (t2.IP_ADDRESS) > (t1.start_ip)) AND ((t2.IP_ADDRESS) = (t1.end_ip) OR (t2.IP_ADDRESS) < (t1.end_ip)) AND (t2.FILENAME is not null and t2.country is null)'; $sql2 = 'SELECT (IP_ADDRESS, FILENAME, country, area, city) from download where FILENAME is not null'; // Update the table $stmt = $con->prepare($sql1); $stmt->execute(); // Get count of rows to be displayed in table $stmt = $con->prepare($sql); $stmt->execute() ; $cnt = $stmt->fetch(PDO::FETCH_NUM); // retrieve one row at a time $i = 1; while($i <= $cnt){ $stmt = $con->prepare($sql2); $row->execute(array('')); // Do I need an array here? // from here on, I'm lost $i++; I'd appreciate any guidance you can provide or understandable tutorials you can point me to. Larry
  2. Hi.. I have a database which works fine. I ve just started using google charts to make the results look better for the U.Experience. . The example tables are very basic like: Country Visits England 4 Usa 6 Brazil 3 I get all my results form where statements so I have no tables which actually count the entries and show them in a basic table like this. My question is : Should I be using where, count() etc statements to populate the charts or should I have mini tables in my schema that present the information neatly like the above or a counter next to the id of the user/country etc e.g. so I don't need to worry about statements in the chart code.... thx for reading.
  3. Hi, I am trying to read in the name and student number that the user entered and compare it to what is in the mysql database. My teacher suggested using found. However I am still not getting anything to echo out. Can someone lead me in the right direction? next.php <?php require 'connect.php'; //linking up to the database $link = mysqli_connect(HOST, USER, PASS, DB) or die (mysqli_connect_error()); //making a variable from the user data $name = mysqli_real_escape_string ($link, $_POST["name"]); $number = mysqli_real_escape_string ($link, $_POST["snumber"]); $course = $_POST["pcourse"]; // select all from table student which show student name and number $squery = "SELECT * FROM students"; $sresult = mysqli_query($link, $squery); while ($srow = mysqli_fetch_array($sresult)) { if ($name == $srow['uid'] && $number == $srow['student']) { if ($found) { echo "$srow[uid] $srow[student]"; } else { echo "Student does not exist"; } } } mysqli_close ($link); ?> <html> <body> <form action="index.php" method="post"> <br> <input type = "submit" value="back" name="back"> </form> </body> </html> This is my index.php that I use as my form <!DOCTYPE html> <html> <body> <h1>Course Selection</h1><br> <form action="next.php" method="post"> Name: <input type="text" name="name" placeholder="Name" required="required" maxlength="50"> <br><br> Student Number: <input type="text" name= "snumber" required="required" maxlength="9"> <br><br> <?php //form require 'connect.php'; $link = mysqli_connect(HOST, USER, PASS, DB) or die(mysqli_connect_error()); echo "Select a course: <select name = \"pcourse\">\n"; $query = "SELECT * FROM course"; $result = mysqli_query($link, $query); while ($row = mysqli_fetch_array($result)) { echo "<option> $row[code=auto:0] $row[name] $row[max]</option><br>"; } mysqli_free_result($results); mysqli_close ($link); echo " </select>\n"; ?> <br><br> <input type = "submit" value="submit" name= "submit"> </form> </body> </html>
  4. I have a table containing 6 records i want to display first four records today and today date should be saved against those 4 records.On the next day remaining two records should be displayed and first two records as well and date should be saved and flag should b incremented as well. i hope you guys are getting my point
  5. Ok i have a code that is supposed to put the checkbox number into a data base the table is set up as playernick card1 card 2 card 3 random(to be used later so null in this application) and the date but when i fill out the form i get this error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURRENT_DATE()')' at line 1 here is the php code from below where it connects to database $checkBox = implode(',', $_POST['whatcard']); if(isset($_POST['submit'])) { $query="INSERT INTO earlyreg VALUES (playernick,'" . $checkBox . "',.,CURRENT_DATE()')"; mysql_query($query) or die (mysql_error() ); echo "Complete"; } ?>
×
×
  • 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.