Jump to content

Search the Community

Showing results for tags 'mysql'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 249 results

  1. I am using phpMyAdmin and currently having trouble trying to make a foreign key. table album - soloID -> table solo artist - id Already tried: Indexing soloID Different sites: youtube, stackoverflow...etc After searching, I have found nobody actually made a detailed tutorial on how to make a foreign key for somebody who already created tables. Hopefully, somebody can help me here.
  2. Table name = variable

    At the top of my page, I have: <?php//connect to dbinclude "MyConnect.php";// $artist = $_GET['Mia'];?> Inside the "MyConnect" is: //get all of the photos$photoList = "";$artist = $_POST['artist'];$sql = mysql_query("SELECT * FROM $artist ORDER BY photoID DESC LIMIT 6");//check for photos$photoCount = mysql_num_rows($sql); if ($photoCount > 0){ while($row = mysql_fetch_array($sql)){ $photoID = $row["photoID"]; $photoName = $row["photoName"]; $photoList .= '<li class="thumb"> <a href="#"><img src="../images/mia/' . $photoName . '.jpg" alt="' . $photoName . '" width="100" height="100" /></a> </li>'; }}else{ $dynamicList = "There are no photos at this time!";} What I'm trying to do is, set $artist to equal Mia which will make FROM $artist into FROM Mia. I want to repeat this on more pages.
  3. MSSQL to MYSQL

    hi,i have got a problem. i have database MSSQL and i want to migration to MYSQL.anysuggestion for me??because i want to build a Ecommerce site.btw anyone know the risk if we publish a database MSSQL using IP public??i think this is a second option if i can't migration to MYSQL. :Sad:
  4. CONCAT sql

    Hi All, I got this sql connection to my table wb, it all seems to work fine in phpmyadmin, when testing sql, but when i want to us it, it comes up with: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING inC:\----------\test3.php on line 75 line 75 is the $query_wb $query_wb = "SELECT CONCAT( "[", GROUP_CONCAT( CONCAT("{weID:'",`weID`,"'"), CONCAT(",weName:'",`weName`,"'}") ) ,"]") AS json FROM wb;"; any Ideas how to make it work??
  5. PHP Loops

    How do I set this kind of loop? First, it fills the cell with the data from the database. <table border="1"><tr><td>Row 1, cell 1</td></tr></table> Then, if there is more data added into the database. <table border="1"><tr><td>Row 1, cell 1</td><td>Row 1, cell 2</td></tr></table> Here's where I want the loop to start. I want it to repeat the process when the row has two cells by creating a new row.
  6. I see these: euckr_korean_ci euckr_bin but none of them are working.
  7. I'm trying to save a lot of time instead of editing the page everytime. Wouldn't it be easier to just change the information in the database, right? I've been searching for days on how to do it but having no luck. I will be very grateful for the help. Thank you. <table id="data"> <tr> <th scope="row">Occupation</th> <td>Singer</td> </tr> <tr> <th scope="row">Debut</th> <td>December 02, 2011</td> </tr> <tr> <th scope="row">Data of Birth</th> <td>February 13, 1990</td> </tr> <tr> <th scope="row">Record Label</th> <td>Ttakttaguri Entertainment</td> </tr> <tr> <th scope="row">Links</th> <td><a href="http://d2kr.com/hboard3/" target="_blank">Official</a>, <a href="http://blog.naver.com/agia0213">Naver Blog</a>, <a href="https://twitter.com/#!/agia0213">Twitter</a>, <a href="http://me2day.net/agia0213" target="_blank">Me2day</a></td> </tr></table>
  8. how to make relation at mysql database

    hello , i has a problemo fo make a relation in database my sql , I use XAMP 1.7.7 , can anyone help me , the relation can work , if delete 1 data in database master then data in database relation also remove , ... thx for help
  9. Hey folks.I have scanned the net for days trying to find anyone else discussing this problem, with no luck.I felt certain that it must be a common problem, but maybe not. In a nutshell:1) insert a record into table Z from script A;2) count(*) on table Z says 1 record (correct);3) link to script B via form submit, method post;4) insert a record into table Z from script B;5) count(*) on table Z says 2 records (correct);6) hit Back button;7) count(*) on table Z says 1 record (incorrect). If I link back to script A, rather than use the Back button, then count(*) says 2 records as it should.If I wait long enough before pressing the Back button (10 minutes) then script A, count(*), says 2 records. This is happening regardless of whether I use mysql_connect or mysql_pconnect. It is also happening regardless of whether or not mysql_close (or mysql_commit) is issued after each insert. As I have read many times recently, the Back button is not your friend. Thanks in advance for any help you can offer.
  10. What's wrong with this?

    function dbErr($num,$n) { switch ($num) { case 1044: case 1045: $err = err("Access to \"{$n}\" denied using current DB User and/or DB Pass."); break; case 1049: $err = err("The database \"{$n}\" does not exist."); break; case 2002: $err = err("There is no such DB Host. Check spelling."); break; default: $err = err("There is a problem connecting to the database. ".mysql_errno().": ".mysql_error()); } return $err; } function dbConnect($h,$u,$p,$n) { if (!$con = @mysql_connect($h,$u,$p)) {$err = dbErr(mysql_errno(),$n);} else if (!@mysql_select_db($n,$con)) {$err = dbErr(mysql_errno(),$n);} return (isset($err)) ? $err : ""; } I got told my code was wrong so I come here hoping people can prove there is a fault in my code. I suspect that people are simply not understanding some PHP syntax. If you can find anything wrong with this, let me know. Edit: I should note that the code works fine, but since I was told by several people it was wrong, I'm out to be proved wrong.
  11. I would like to offer to the visitors of my website the possibility for them to enter their email address in order to receive sometime a newsletter from my website.How to code the input form to get their email address?How to code the procedure to check the good validity of the email?How to code the storage in MySQL?How to code the procedure of sending an email to confirm the subscription and also to propose a link to unsubscribe?How to code to retrieve the email stored in the database when wishing to send a newsletter?And then, how to code the sending of this newsletter? I am ok with HTML/XHTML & CSS but I need help regarding how to handle PHP, MySQL and other things necessary to do the above project. Can someone help me? Thanks.H Olivier Dauxais.
  12. Mysql error PLEASE HELP

    So me and a friend have a website (actually my friends but i work on it with him). He set up a mysql database and i set up a php registration thingy. It through back this error: Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in /hermes/bosweb26b/b867/ipg.escratchorg/scope/process.php on line 6Lost connection to MySQL server at 'reading initial communication packet', system error: 111 Please help and if you need me to show files i will. (website is scope.escratch.org/register.html) ~SCOPE
  13. populate drop down menu from mysql using php

    Hi! I have a code where I populate the drop down list base on one of the columns in my database. It already display but the value of the chosen list did not affect my mysql query. Now I wanted to ask how I can put the value of the list to my mysql query.This is my code: <?php// db connection$db = "mds_reports";[/indent]if($connect = mysql_connect("172.16.8.32", "mds_reports", "password")) $connect = mysql_select_db($db); else die("Unable to connect".mysql_error());$date_from = $_POST['dfrom'];$date_to = $_POST['dto'];?><html><head><title>Cancelled Orders </title></head><body> <h1>Cancelled Orders</h1> <form name="cancelled_orders" method="POST" action="cancelled_orders_index.php"> Date From: <input type="text" name="dfrom" id="dfrom"> To: <input type="text" name="dto" id="dto"><br /><br /> <?php $i = $_POST['name']; $result_query = mysql_query ("SELECT name FROM restaurant_master") or die (mysql_error()); echo "<select name='name' value=''>Restaurant Name</option>"; $i=1; while($nt=mysql_fetch_assoc($result_query)) { echo "<option selected value='$i' > $nt[name] </option>"."<BR>"; $i++; } echo "</select>"; ?> <input name="submit" type="submit" value="Go"> </form> <table> <table border="2" cellpadding="2" cellspacing="1" style='width:100%;'> <tr> <th>Restaurant Code</th> <th>Restaurant Name</th> <th>Order No</th> <th>Order Source</th> <th>Payment Type</th> <th>Net Total</th> <th>Gross Total</th> <th>Reason</th> </tr> <?php if(isset($_POST['submit'])){ echo "Date select from $date_from to $date_to"."</p>"; echo "Restaurant: $i"."</p>"; $sql = "Select restaurant_master.code, restaurant_master.name, mds_orders.OrderNo, mds_orders.OrderSourceText AS 'Order Source', mds_orders.PaymentTypeText AS 'Payment Type', mds_orders.NetTotal, mds_orders.GrossTotal, ReasonMaster.ReasonDescription AS 'Reason' FROM mds_orders INNER JOIN ReasonMaster ON mds_orders.ReasonFKID = ReasonMaster.PKID INNER JOIN restaurant_master ON mds_orders.RestaurantID = restaurant_master.pkid WHERE mds_orders.OrderDate BETWEEN '".$date_from." 00:00:00' AND '".$date_to." 23:59:59' AND mds_orders.RestaurantID LIKE '$i' AND mds_orders.StatusFKID = 3 ORDER BY restaurant_master.code"; echo $sql; $result = mysql_query($sql) or die("Error: ".mysql_error()); $num_rows = mysql_num_rows($result); $i = 0; if (mysql_num_rows($result) >0) { while ($row = mysql_fetch_array($result,MYSQL_ASSOC)){ $csv .= $row['code'].",". $row['name'].",". $row['OrderNo'].",". $row['Order Source'].",". $row['Payment Type'].",". $row['NetTotal'].",". $row['GrossTotal'].",". $row['Reason'].","."<br>"; ?> <tr> <td><?php echo $row['code'];?></td> <td><?php echo $row['name'];?></td> <td><?php echo $row['OrderNo'];?></td> <td><?php echo $row['Order Source'];?></td> <td><?php echo $row['Payment Type'];?></td> <td><?php echo $row['NetTotal'];?></td> <td><?php echo $row['GrossTotal'];?></td> <td><?php echo $row['Reason'];?></td> </tr> <?php }}} ?> </table><br /> <form name="export" method="POST" action="cancelled_orders_export.php"> <input type="hidden" name="cancel_dfrom" id="data" value="<?=$date_from?>"> <input type="hidden" name="cancel_dto" id="data" value="<?=$date_to?>"> <input type="hidden" name="cancel_name" id="data" value="<?=$name;?>"> <input type="submit" name="extract" value="Extract"> </form></body></html> Thanks and best regards.
  14. SQL Connection to old accounts

    I have a major problem with SQL Database. I have a site im working on with over 1k members. When old members book an event the event does not show on their member page. however when a new member joins then goes to book an even the event shows up on their member page. this is getting very confusing. I do know that we attracted some malware onto the site before all the problem started. However this has been cleaned off and there is now no trace of the malware. Can anyone help as im all out of ideas for fixes. I dont want to have to manually rebuild the database as this is too time confusing and would take a long time. Thanks in advance.
  15. SQL ERROR in phpMyAdmin

    I have a query where I will display how many transactions are made base on the amount of each transaction. But it has an error, the error is that the last amount which is 1,000 above is the same with the total transaction. Can someone check my query? This is my query: SELECT restaurant_master.code, restaurant_master.name, COUNT(CASE WHEN mds_orders.GrossTotal < '100' THEN 1 END) AS less100, COUNT(CASE WHEN mds_orders.GrossTotal >= '100' AND mds_orders.GrossTotal < '200' THEN 1 END) AS less200, COUNT(CASE WHEN mds_orders.GrossTotal >= '200' AND mds_orders.GrossTotal < '300' THEN 1 END) AS less300, COUNT(CASE WHEN mds_orders.GrossTotal >= '300' AND mds_orders.GrossTotal < '400' THEN 1 END) AS less400, COUNT(CASE WHEN mds_orders.GrossTotal >= '400' AND mds_orders.GrossTotal < '500' THEN 1 END) AS less500, COUNT(CASE WHEN mds_orders.GrossTotal >= '500' AND mds_orders.GrossTotal < '600' THEN 1 END) AS less600, COUNT(CASE WHEN mds_orders.GrossTotal >= '600' AND mds_orders.GrossTotal < '700' THEN 1 END) AS less700, COUNT(CASE WHEN mds_orders.GrossTotal >= '700' AND mds_orders.GrossTotal < '800' THEN 1 END) AS less800, COUNT(CASE WHEN mds_orders.GrossTotal >= '800' AND mds_orders.GrossTotal < '900' THEN 1 END) AS less900, COUNT(CASE WHEN mds_orders.GrossTotal >= '900' AND mds_orders.GrossTotal < '1000' THEN 1 END) AS less1k, COUNT(CASE WHEN mds_orders.GrossTotal > '1000' THEN 1 END) AS gtr1k, COUNT(mds_orders.GrossTotal) AS total FROM mds_orders JOIN restaurant_master ON mds_orders.RestaurantID = restaurant_master.PKID WHERE mds_orders.OrderDate BETWEEN '2011-11-01' AND '2011-11-30' GROUP BY restaurant_master.code, restaurant_master.name"; --Thanks. Best Regards.
  16. Hello internet. I have been looking around and I'm not sure I have found the method to use to complete this task. Here it is:- I want the user to send three numerical guesses to my database (this is no problem)- I will submit my own three numbers that will be the actual numbers the user will be trying to guess (this is no problem)- I want to send all those rows through a check function and then assign a value for each row based on how well they did guessing the number (this is where I am having an issue)- I would then like to echo back to the user all the guess totals - along with the names - in a table (this will not be a problem) I think I can handle all of this except how to write the function and send all the rows in mysql through that function and then assign a "total" value for each row based on how well then did guessing. Your help is appreciated.
  17. Hello internet. I am trying to set up a query that will check to see if there is a row in the database that has the same name the user is trying to submit. Here is my code... how do I make this work? <?php$con = mysql_connect("xxx","xxx","xxx");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("xxx", $con);$entry=mysql_query("Select FROM testmysql where name='$_POST[rname]'");if($entry='$_POST[rname]');{echo "There is an entry that already exists with the name you selected. Please change the name and re-submit. Thanks.";die();
  18. Hello internet. I am finding it difficult to find any information on how to actually select just one row of data based on the user supplying two specific entries. Any suggestions? I have tried to use select but cannot get it to work to pull a row out with the user specifying which row by entering two specific entries. Please help.
  19. Xampp Mysql

    Asalam-o-aliqum or Hello I am facing problem when connect MySQL database in XAMPP localhost if you know the answer plz replay Thanks. I have write "Asalam-o-aliqum" which Muslims says when meet someone. instead of hello.
  20. Hi guysI am working on something tricky about display an image under the date text inside the cell in jquery calendarI don't mind about the plug-in of Jquery, My question is how we can assign a certain data for a cell date in the calendar assuming I have an array of values from the database and I want to assign each array element for a specific date? any idea?thanks in advance for any help
  21. Php Search

    Hi everyone, i have created a project in php, its a phonebook. for example i have two name as alex, when i search it brings me just one alex. How can i bring that second alex. Can you check my codes pls. <?php error_reporting("0"); require_once('Connections/baglanti.php'); ?><?phpif (!function_exists("GetSQLValueString")) {function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = ""){ if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue;}}$currentPage = $_SERVER["PHP_SELF"];$maxRows_arama = 10;$pageNum_arama = 0;if (isset($_GET['pageNum_arama'])) { $pageNum_arama = $_GET['pageNum_arama'];}$startRow_arama = $pageNum_arama * $maxRows_arama;$colname_arama = "-1";if (isset($_GET['kelime'])) { $colname_arama = $_GET['kelime'];}mysql_select_db($database_baglanti, $baglanti);$query_arama = sprintf("SELECT * FROM rehber WHERE adi LIKE %s " , GetSQLValueString("%" . $colname_arama . "%", "text"));$query_limit_arama = sprintf("%s LIMIT %d, %d", $query_arama, $startRow_arama, $maxRows_arama);$arama = mysql_query($query_limit_arama, $baglanti) or die(mysql_error());$row_arama = mysql_fetch_assoc($arama);if (isset($_GET['totalRows_arama'])) { $totalRows_arama = $_GET['totalRows_arama'];} else { $all_arama = mysql_query($query_arama); $totalRows_arama = mysql_num_rows($all_arama);}$totalPages_arama = ceil($totalRows_arama/$maxRows_arama)-1;$queryString_arama = "";if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_arama") == false && stristr($param, "totalRows_arama") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_arama = "&" . htmlentities(implode("&", $newParams)); }}$queryString_arama = sprintf("&totalRows_arama=%d%s", $totalRows_arama, $queryString_arama);mysql_free_result($arama);?><form id="form3" name="form3" method="post" action="index.php"> <input type="submit" name="ANASAYFA" id="ANASAYFA" value="ANASAYFA" /></form><p> </p><table border="1" align="center"> <tr> <td>id</td> <td>adi</td> <td>soyadi</td> <td>gsm</td> <td>ev</td> <td>web</td> <td>mail</td> </tr> <?php do { ?> <tr> <td><a href="ayrinti.php?recordID=<?php echo $row_arama['id']; ?>"> <?php echo $row_arama['id']; ?> </a></td> <td><?php echo $row_arama['adi']; ?> </td> <td><?php echo $row_arama['soyadi']; ?> </td> <td><?php echo $row_arama['gsm']; ?> </td> <td><?php echo $row_arama['ev']; ?> </td> <td><?php echo $row_arama['web']; ?> </td> <td><?php echo $row_arama['mail']; ?> </td> </tr> <?php } while ($row_arama = mysql_fetch_assoc($arama)); ?> <?php do { ?> <?php } while ($row_arama = mysql_fetch_assoc($arama)); ?> <?php do { ?> <tr> <td><a href="ayrinti.php?recordID=<?php echo $row_arama['id']; ?>"> <?php echo $row_arama['id']; ?> </a></td> <td><?php echo $row_arama['adi']; ?> </td> <td><?php echo $row_arama['soyadi']; ?> </td> <td><?php echo $row_arama['gsm']; ?> </td> <td><?php echo $row_arama['ev']; ?> </td> <td><?php echo $row_arama['web']; ?> </td> <td><?php echo $row_arama['mail']; ?> </td> </tr> <?php } while ($row_arama = mysql_fetch_assoc($arama)); ?> <?php do { ?> <?php } while ($row_arama = mysql_fetch_assoc($arama)); ?> </table><br><table border="0"> <tr> <td><?php if ($pageNum_arama > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_arama=%d%s", $currentPage, 0, $queryString_arama); ?>">İlk</a> <?php } // Show if not first page ?></td> <td><?php if ($pageNum_arama > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_arama=%d%s", $currentPage, max(0, $pageNum_arama - 1), $queryString_arama); ?>">Önceki</a> <?php } // Show if not first page ?></td> <td><?php if ($pageNum_arama < $totalPages_arama) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_arama=%d%s", $currentPage, min($totalPages_arama, $pageNum_arama + 1), $queryString_arama); ?>">Sonraki</a> <?php } // Show if not last page ?></td> <td><?php if ($pageNum_arama < $totalPages_arama) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_arama=%d%s", $currentPage, $totalPages_arama, $queryString_arama); ?>">Son</a> <?php } // Show if not last page ?></td> </tr></table><p>Kayıtlar <?php echo ($startRow_arama + 1) ?> hedef: <?php echo min($startRow_arama + $maxRows_arama, $totalRows_arama) ?> / <?php echo $totalRows_arama ?></p><p> </p><form id="form1" name="form1" method="post" action="index.php"> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <p> <input type="submit" name="GERİ" id="GERİ" value="GERİ" /> </p> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote></form><p> </p>
  22. Export Dynamic Data To Pdf With Php

    Hello,I had page that display results dynamically from the database, I need to export that html table to pdf.Any help?Thanks
  23. Advanced Php Tutorial

    I know the basics of PHP and MYSQL but I can't seem to get down putting it all together in order to make an admin panel / website backend. I was wondering if anyone knew of any specific tutorials that covered creating admin panels / website backends so I could get a feel of what I'm doing right and what I'm doing wrong.
  24. Hi i'm a newbie in this forum i like W3S is the best page ever for learning and be a web developer and i need help... how do i know if a filed is empty on php & mysql block code and make a redirection on the same page or other files for example... if we have a form called and have this code <html><body><form action="insert.php" method="post">Firstname: <input type="text" name="firstname" />Lastname: <input type="text" name="lastname" />Age: <input type="text" name="age" /><input type="submit" /></form></body></html> and then we have this file call it <?php$con = mysql_connect("localhost","peter","abc123");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("my_db", $con);$sql="INSERT INTO Persons (FirstName, LastName, Age)VALUES('$_POST[firstname]','$_POST[lastname]','$_POST[age]')";if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); }echo "1 record added";mysql_close($con)?> and if a have fristname as a UNIQUE field in mysql... how do i know if a field is empty and make a redirection to a pages or file? (that includes same files on your root folder) i hope that you help me thx
×