PHP - Selecting Data From Mysql To Display In Tcpdf
Hi all, I am trying to get data from MySQL to display in a html table in TCPDF but it is only displaying the ID. $accom = '<h3>Accommodation:</h3> <table cellpadding="1" cellspacing="1" border="1" style="text-align:center;"> <tr> <th><strong>Organisation</strong></th> <th><strong>Contact</strong></th> <th><strong>Phone</strong></th> </tr> <tbody> <tr>'. $id = $_GET['id']; $location = $row['location']; $sql = "SELECT * FROM tours WHERE id = $id"; $result = $con->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { '<td>'.$location.'</td> <td>David</td> <td>0412345678</td> </tbody>'; } } '</tr> </table>'; Anyone got any ideas? Similar TutorialsHi I have a table (applicant) and I am looking at producing a pdf displaying various items of data from this table. I have succeeded in getting the look I want but in my query I use a fixed applicantid (in this case an id of 4). What I want to be able to do is to have the id cary according to the url. In other words, when someone comes from one web page to this one and the url is of the format .../pdf_production.php?applicantid=42. I'm not sure I've explained that very well but I hope someone can help - I think this is the last thing I need to sort out. Many thanks in advance. The code I have so far is: <?php require_once('../Connections/process.php'); ?> <?php require_once('../tcpdf/config/lang/eng.php'); require_once('../tcpdf/tcpdf.php'); // get data from users table mysql_select_db($database_process, $process); $result = mysql_query("SELECT * FROM applicant WHERE applicantid = '4'"); while($row = mysql_fetch_array($result)) { $appid = $row['applicantid']; $idcode = $row['idcode']; $type = $row['type']; $company = $row['company']; $email = $row['email']; } // create new PDF document $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetPrintHeader(false); $pdf->SetPrintFooter(false); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); //set margins $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); //set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings $pdf->setLanguageArray($l); // --------------------------------------------------------- // set font $pdf->SetFont('dejavusans', '', 10); // add a page $pdf->AddPage(); // create some HTML content $txt = <<<EOD Below are the details I require Company type: $type Company Name: $company Company email: $email EOD; // output the HTML content // $pdf->writeHTML($htmlcontent, true, 0, true, 0); $pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0); // $pdf->writeHTML($inlinecss, true, 0, true, 0); // reset pointer to the last page // $pdf->lastPage(); //Close and output PDF document $pdf->Output('example_006.pdf', 'I'); //============================================================+ // END OF FILE //============================================================+ ?> Hi I am trying to select and order data/numbers from a colum in a mysql data base however i run the code and it returns no value just a blank page no errors or any thing so i think the code is working right but then it returns no result? Please help thanks Here is the code: <?php $host= "XXXXXX"; $mysql_user = "XXXXXX"; $mysql_password = "XXXXXX"; $mysql_database = "XXXXXXX"; $connection = mysql_connect("$host","$mysql_user","$mysql_password") or die ("Unable to connect to MySQL server."); mysql_select_db($mysql_database) or die ("Unable to select requested database."); $row = mysql_fetch_assoc( mysql_query( "SELECT XP FROM Game ORDER BY number DESC LIMIT 1" ) ); $number = mysql_result(mysql_query("SELECT XP FROM Game ORDER BY number DESC LIMIT 1"), 0); echo "The the highest XP is $number"; ?> I have the following code, and really can't see what is wrong with it. Any help would be great. <?php if (!mysql_connect('127.0.0.1', 'root', '')) { echo 'Could not connect to mysql'; exit; } $dbname = 'Requests'; $result = mysql_list_tables($dbname); if (!$result) { echo "DB Error, could not list tables\n"; echo 'MySQL Error: ' . mysql_error(); exit; } while($row2 = mysql_fetch_row($result)) { foreach ($row2[0] as $table_id) { $query = "SELECT * FROM $table_id"; $dbresult = mysql_query($query); // added code to use the tablename and select all records from that table // create a new XML document $doc = new DomDocument('1.0'); // create root node $root = $doc->createElement('mixes'); $root = $doc->appendChild($root); // process one row at a time while($row = mysql_fetch_assoc($dbresult)) { // add node for each row $occ = $doc->createElement($table_id); $occ = $root->appendChild($occ); // add a child node for each field foreach ($row as $fieldname => $fieldvalue) { $child = $doc->createElement($fieldname); $child = $occ->appendChild($child); $value = $doc->createTextNode($fieldvalue); $value = $child->appendChild($value); } // foreach } // while } } echo 'Wrote: ' . $doc->save("s.xml") . ' bytes'; // Wrote: 72 bytes ?> SELECT * FROM `booking_tbl` WHERE booking_status = 'Check In' AND departure_date_time = NOW()"I use the datetime datatype for the departure_date_time so i can get data from that data because it checking the date and time but i want it to check on the date from the datetime datatype So how can i get the data only with that date without the time in the mysql datetime datatype I want to produce a pdf document using mysql and TCPDF. I can do this OK in some circumstances but I now have a problem. I have two tables - documents and parties - they are linked by a common field docid. I have for table documents, the fields: docid, doctitle, idcode and for the parties table: partyid, docid, party (the field party is the name of the party) For any document there could be any number of parties and for a single idcode there could be any number of documents. For example, for idcode = 12345 there might be 2 documents called doctitle 1 and doctitle 2. For doctitle 1 there are 3 parties to it party1, party 2 and party 3. For doctitle 2 there are two parties - party4 and party 5. For any idcode (which is passed through by the url) I want the pdf to give a list such as: Doctitle 1: party name 1 party name 2 party name 3 Doctitle 2: party name 4 party name 5 Part of my code is: mysql_select_db($database_process, $process); $result2 = mysql_query("SELECT parties.docid, GROUP_CONCAT(party SEPARATOR '<br>') AS partylist, documents.doctitle FROM parties INNER JOIN documents ON parties.docid=documents.docid WHERE parties.idcode = '$appidpassed' GROUP BY parties.docid LIMIT 1 ") or die(mysql_error()); while($row = mysql_fetch_array($result2)) { $doctitle = $row['doctitle']; $parties = $row['partylist']; } and then further down the page: $doctitle<br> $parties This only gives one document and the parties associated with it. I know the solution is probably easy but I can't see it. Does anyone have any ideas? Hi I have used TCPDF to generate documents with single values from a mysql table. Now I want to generate a calendar. I have a table events_pbw which contains (amongst others) the fields id, date and name. I would like to generate a pdf which lists all of the results for entries after a particular date (eg Jan 1st) I have this: // get data from events_pbw table $result = mysql_query("SELECT id, date, name FROM events_pbw WHERE `date` > 2011-01-01" "); while($row = mysql_fetch_array($result)) { $appid = $row['id']; $date = $row['date']; $name = $row['name']; } But I don't know how to get the full list of results into the pdf. I'm sure this is very easy but I'm not great on php coding! Does anyone have any examples or help they could give me? Many thanks I am managing a shop website which is using php and mysql for data. The website has a section that will display the related products with the one that you are watching. Now my problem is that if there are more than 5 items it will continue to display all the items in one row with the consequent that the page will not display well. I need to find a way to begin a new row after the 5th item so it will display 5 items in each row. this is my current code that is responsible for showing the related items. There is also a picture attached with the problem. while ($row = mysql_fetch_array($retd)) { $code = $row["code"]; $name = $row["name"]; echo("<td width=150 align=center>"); echo ("<a href=../products/info.php?scode=$code><img src=pictures/$code.gif border=0 alt=Item $name</a>"); echo ("<br><a href=../products/info.php?scode=$code><span class=fs13>$name</span></a>"); echo("</td>"); } Does anyone know how can I do this? I'm not sure what I'm doing wrong here... This is my index <html <head> <title>Admin applications</title> </head> <body text="#000000"> <center> <?php include("connect.php"); echo "<table cellpadding='3' cellspacing='2' summary='' border='3'>"; echo "<tr><td>Real name:<br><br>"; echo $row['real_name']; echo "</td><td>Age:<br><br>"; echo $row['age']; echo "</td><td>In-Game Name:<br><br>"; echo $row['game_name']; echo "</td><td>Steam ID:<br><br>"; echo $row['steamid']; echo "</td><td>Agreement:<br><br>"; echo $row['agreement']; echo "</td><td>Will use vent:<br><br>"; echo $row['vent']; echo "</td><td>Activity:<br><br>"; echo $row['activity']; echo "</td><td>Why this person wants to be an admin:<br><br>"; echo $row['why']; echo "</td></tr></table>"; ?> </center> </body> </html> and this is my database connect <?php $database="admin"; mysql_connect ("localhost", "root", "waygan914"); @mysql_select_db($database) or die( "Unable to select database"); mysql_query("SELECT * FROM applications"); ?> The database table "applications" has 8 fields, and 2 records, but when I view the page i get the table but no data: Hi guys I need your help. I would like the data from the column "user_login" being seen as an email link. How can I do that? Thousand Thanks Code: [Select] while($rows=mysql_fetch_array($result)){ ?> <tr> <td><span class="style10"><? echo $rows['user_id']; ?></span></td> <td><span class="style10"><? echo $rows['user_first_name']; ?></span></td> <td><span class="style10"><? echo $rows['user_surname']; ?></span></td> <td><span class="style10"><? echo $rows['user_login']; ?></span></td> <td align="center"><a href="update.php?id=<? echo $rows['user_id']; ?>" class="style10">update</a></td> </tr> <?php } Morning all, and Evening everyone else. Im using the following Query to display information from a table Code: [Select] <? include "config.php"; $query1="Select *,DATE_FORMAT(date_posted,'%W,%d %b %Y') as thedate FROM article WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) ORDER BY date_posted DESC LIMIT 1 "; $blogarticles = mysql_query($query1) or die(mysql_error()); $num = mysql_num_rows($blogarticles); ?> What I am wanting to find out, is as the blog post itself could be pages long at times, is the anyway that further down the page where I actually call the data up onto the page itself I can limit how much of it is displayed? Ive succesfully added a limit to how many records are shown with the "DES LIMIT 1", is there something I can add to my query, or further down in my displaying table (which I will code just below here) to limit the lines/characters on display until the full article is opened? Display table: Code: [Select] <table width="75%" border="0" cellspacing="1" align="left"> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <? if($num > 0){ while($row_articles = mysql_fetch_assoc($blogarticles)){ ?> <tr class="title"> <td><?=$row_articles['title'];?> </td> </tr> <tr> <td> </td> </tr> <tr class="tbody"> <td><?=$row_articles['comments'];?></td> </tr> <tr> <td> </td> </tr> <tr class="links"> <td>Date posted: <?=$row_articles['date_posted'];?> | <a href="comments.php?aid=<?=$row_articles['artid'];?>&cid=<?=$row_articles['categoryID'];?>">Comments(<? //echo $row_articles['artid']; //$thenum=row_articles['artid']; $getcomments = "SELECT * FROM article WHERE artchild='".$row_articles['artid']."'"; if(!$theResult=mysql_query($getcomments)){ echo mysql_error(); }else{ $num_comments=mysql_num_rows($theResult); echo $num_comments; } ?>) </a></td> </tr> <tr class="links"> <td> </td> </tr> <tr class="links"> <td> </td> </tr> <? } }else{ ?> <tr><td><p>There are no articles available at present</p></td></tr> <? } ?> <tr> </tr> </table> Just to clarify 'comments' is the table field that holds the blog data, it also holds comments on the blog, but the child ID is what differentiates them from one another. Thanks in advance for your help ladies & gents Tom I have got connection to the the mysql database, how do I get the data from the database to display on the webpage im making a game and i need to show a users money but i dont know how help? I have created 5 websites under 5 different domains. Contents of this websites' are similar and using a same template for each one. Now I need to create an admin panel to control these websites. PHP and MySql I will use for this backend.
My problem is how can I manage these five website with one backend? Reason is I will use different domain for my backend. My all 5 client will use this same backend system to manage their own website.
So can I know from the professionals here, is it possible to display mysql data on these 5 website. If it is possible then how?
Any links to article or tutorials would be welcome and appreciated.
NOTE: I checked
mysql federated storage enginebut no idea? Is it the way where do I need to go? Thank you. Hey in my edit page i have 2 radio buttons in my form and i need to make sure the same value is still selected how can i do that? thanks i have a mysql table which contains name like mid mname 101 AAA 102 BBB 103 CCC now i have to print this name in a html table like AAA, BBB, CCC i am getting this by while loop in a variable but when loop changes then value also change so please tell me how i get this only in one variable & print I had this working, but when I try and get fancy and use AJAX the data doesn't display. I think this is a PHP problem though. My code for the select form including AJAX code Code: [Select] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB"> <head> <title>AJAX Example</title> <link rel="stylesheet" type="text/css" href="Form.css" media="screen" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("tr:odd").addClass("odd"); }); </script> <script type="text/javascript"> function showPlayers(str) { var xmlhttp; if (str=="") { document.getElementById("DataDisplay").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); else {// code for IE6, IE5 } xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("DataDisplay").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","Query.php?category_id="+str,true); xmlhttp.send(); } </script> </head> <body> <h1">AJAX Example</h1> <?php #connect to MySQL $conn = @mysql_connect( "localhost","username","pw") or die( "You did not successfully connect to the DB!" ); #select the specified database $rs = @mysql_SELECT_DB ("MyDB", $conn ) or die ( "Error connecting to the database test!"); ?> <form name="sports" id="sports"> <legend>Select a Sport</legend> <select name="category_id" onChange="showPlayers(this.value)"> <option value="">Select a Sport:</option> <?php $sql = "SELECT category_id, sport FROM sports ". "ORDER BY sport"; $rs = mysql_query($sql); while($row = mysql_fetch_array($rs)) { echo "<option value=\"".$row['category_id']."\">".$row['sport']."</option>\n "; } ?> </select> </form> <br /> <div id="DataDisplay"></div> </body> </html> Query.php <?php #get the id $id=$_GET["category_id"]; #connect to MySQL $conn = @mysql_connect( "localhost","username","pw") or die( "Error connecting to MySQL" ); #select the specified database $rs = @mysql_SELECT_DB ("MyDB", $conn ) or die ( "Could not select that particular Database"); #$id="category_id"; #create the query $sql ="SELECT * FROM sports INNER JOIN players ON sports.category_id = players.category_id WHERE players.category_id = '".$id."'"; echo $sql; #execute the query $rs = mysql_query($sql,$conn); #start the table code echo "<table><tr><th>Category ID</th><th>Sport</th><th>First Name</th><th>Last Name</th></tr>"; #write the data while( $row = mysql_fetch_array( $rs) ) { echo ("<tr><td>"); echo ($row["category_id"] ); echo ("</td>"); echo ("<td>"); echo ($row["sport"]); echo ("</td>"); echo ("<td>"); echo ($row["first_name"]); echo ("</td>"); echo ("<td>"); echo ($row["last_name"]); echo ("</td></tr>"); } echo "</tr></table>"; mysql_close($conn); ?> I think the problem is either with this part in the AJAX Code: [Select] xmlhttp.open("GET","Query.php?category_id="+str,true); or most likely in my Query.php code when I wasn't using AJAX and using POST it worked fine, but adding the AJAX stuff and GET it doesn't work. When I echo out the SQL the result is Code: [Select] SELECT * FROM sports INNER JOIN players ON sports.category_id = players.category_id WHERE players.category_id = '' so the category_id is not being selected properly and that is the primary key/foreign key in the MySQL table which connects the JOIN. i have 8 division (div), i want to display 4 rows in 4 division and the remain 4 rows in the next 4 division here is my code structure for carousel
<div class="nyie-outer"> second row third row
fourth row fifth row sixth row seven throw eighth row
</div><!--/.second four rows here-->
sql code
CREATE TABLE product( php code
<?php how can i echo that result in those rows
Hi there, I have a bit of a situation that I'm stuck on, I have a list of items that are in a playlist and when the mediaplayer finishes the current item I want it to redirect to the next item in the playlist. The song is grabbed from the database through the ID in the URL (EG. v=1) Song1 (v=1) Song2 (v=2) Song3 (v=3) If the current song is Song1 then when the mediaplayer has finished I want it to then go to the next song (Song2, V=2). Code: [Select] $get = mysql_query("SELECT * FROM `music` WHERE `musicartist`='".$m['musicartist']."' ORDER BY musictitle") or die(mysql_error()); $geti = mysql_fetch_array($get); $ci1 = mysql_query("SELECT * FROM music WHERE musicid > '".$geti['musicid']."' ORDER by musicid ASC LIMIT 1")or die(mysql_error()); $ci = mysql_fetch_array($ci1); I currently have this but I know I'm wrong! When the next song comes on the playlist sort of goes crazy.. http://www.mymediaupload.com/music.php?v=179 You don't have to listen to the song, just slide the slider on the playlist to the end, and the next page that is loaded is ID171 when its supposed to be (HORN OF OCS which is 197) The full result of $geti is below: Code: [Select] <table border=1 cellspacing=1 cellpadding=0><tr> <th>musicid</th><th>musictitle</th><th>musicartist</th><th>musicgenre</th><th>musiclocation</th><th>musicuploaderid</th><th>musicuploader</th><th>musicalbum</th><th>views</th><th>musicalbumart</th><th>dateadded</th><th>itunes</th><th>feature</th><th>rating</th><th>active</th><th>raw</th><th>notes</th><th>notesuser</th><th>mmupick</th></tr> <tr> <td>170</td><td>All I Ever Wanted</td><td>Basshunter</td><td>Dance</td><td>Music/02 All I Ever Wanted.mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>58</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>186</td><td>All I Ever Wanted [Ultra DJ's Mix]</td><td>Basshunter</td><td>Remix</td><td>Music/02 All I Ever Wanted [Ultra DJs Mix.mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>26</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>164</td><td>Angel In The Night</td><td>Basshunter</td><td>Dance</td><td>Music/05 Angel In The Night.mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>60</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>187</td><td>Angel In The Night [Headhunters Remix]</td><td>Basshunter</td><td>Remix</td><td>Music/03 Angel In The Night [Headhunters R.mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>78</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>214</td><td>Basscreator</td><td>Basshunter</td><td>Dance</td><td>Music/11 Bass Creator.mp3</td><td>1</td><td>MMU_Admin</td><td>LOL (International V)</td><td>42</td><td>http://www.mymediaupload.com/Music/Artwork/5051442800128.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>191</td><td>Camila (Swedish Version)</td><td>Basshunter</td><td>Dance</td><td>Music/08 Camilla [Swedish Version].mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>40</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>182</td><td>Can You</td><td>Basshunter</td><td>Dance</td><td>Music/12 Can You.mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>37</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>177</td><td>Day And Night</td><td>Basshunter</td><td>Dance</td><td>Music/07 Day And Night.mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>29</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>175</td><td>Dont Walk Away</td><td>Basshunter</td><td>Dance</td><td>Music/05 Dont Walk Away.mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>59</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>1</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>90</td><td>Dota</td><td>Basshunter</td><td>Dance</td><td>Music/Basshunter - Dota.mp3</td><td>8</td><td>Roge</td><td>LOL (International V)</td><td>207</td><td>http://www.mymediaupload.com/Music/Artwork/5051442800128.jpg</td><td>2009-11-07</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>213</td><td>Dota 2007 [DJ Ellan Remix]</td><td>Basshunter</td><td>Remix</td><td>Music/15 Dota 2007 ( Dj Ellan mix).mp3</td><td>1</td><td>MMU_Admin</td><td>LOL (International V)</td><td>34</td><td>http://www.mymediaupload.com/Music/Artwork/5051442800128.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>166</td><td>Every Morning</td><td>Basshunter</td><td>Dance</td><td>Music/Every Morning.mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>34</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>217</td><td>Every Morning [Hot Pink Delorean Remix]</td><td>Basshunter</td><td>Remix</td><td>Music/Every Morning (Hot Pink Delorean Rem.mp3</td><td>1</td><td>MMU_Admin</td><td>LOL (International V)</td><td>63</td><td>http://www.mymediaupload.com/Music/Artwork/5051442800128.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>167</td><td>Every Morning [Micheal Mind Edit]</td><td>Basshunter</td><td>Remix</td><td>Music/Every Morning (Michael Mix).mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>32</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>168</td><td>Every Morning [Raindropz Mix]</td><td>Basshunter</td><td>Remix</td><td>Music/Every Morning (Raindropz Mix).mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>28</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>179</td><td>Far From Home</td><td>Basshunter</td><td>Dance</td><td>Music/09 Far From Home.mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>39</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>196</td><td>Heaven</td><td>Basshunter</td><td>Dance</td><td>Music/Heaven.mp3</td><td>1</td><td>MMU_Admin</td><td>LOL (International V)</td><td>33</td><td>http://www.mymediaupload.com/Music/Artwork/5051442800128.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>197</td><td>Horn Of Orcs</td><td>Basshunter</td><td>Dance</td><td>Music/Horn Of Orcs.mp3</td><td>1</td><td>MMU_Admin</td><td>LOL (International V)</td><td>45</td><td>http://www.mymediaupload.com/Music/Artwork/5051442800128.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>171</td><td>I Can Walk On Water</td><td>Basshunter</td><td>Dance</td><td>Music/10 I Can Walk On Water.mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>32</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>178</td><td>I Can't Deny [Featuring Lauren]</td><td>Basshunter</td><td>Remix</td><td>Music/08 I Cant Deny [Feat. Lauren].mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>31</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>180</td><td>I Know You Know</td><td>Basshunter</td><td>Dance</td><td>Music/10 I Know U Know.mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>32</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>165</td><td>I Miss You</td><td>Basshunter</td><td>Dance</td><td>Music/04 Basshunter - I Miss You.mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>52</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>188</td><td>I Miss You [Hyperzone Remix]</td><td>Basshunter</td><td>Remix</td><td>Music/04 I Miss You [Hyperzone Remix].mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>25</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>172</td><td>I Promised Myself</td><td>Basshunter</td><td>Dance</td><td>Music/02 I Promised Myself.mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>35</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>176</td><td>I Still Love</td><td>Basshunter</td><td>Dance</td><td>Music/06 I Still Love.mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>30</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>174</td><td>I Will Love Again [Featuring Stunt]</td><td>Basshunter</td><td>Remix</td><td>Music/04 I Will Learn To Love Again [Feat..mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>56</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>198</td><td>I Will Touch The Sky</td><td>Basshunter</td><td>Dance</td><td>Music/I Will Tuch The Sky.mp3</td><td>1</td><td>MMU_Admin</td><td>LOL (International V)</td><td>88</td><td>http://www.mymediaupload.com/Music/Artwork/5051442800128.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>199</td><td>I&#39;m So In Love With You</td><td>Basshunter</td><td>Dance</td><td>Music/Im So In Love With You.mp3</td><td>1</td><td>MMU_Admin</td><td>LOL (International V)</td><td>30</td><td>http://www.mymediaupload.com/Music/Artwork/5051442800128.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>215</td><td>In Her Eyes</td><td>Basshunter</td><td>Dance</td><td>Music/11 In Her Eyes - Basshunter.mp3</td><td>1</td><td>MMU_Admin</td><td>LOL (International V)</td><td>42</td><td>http://www.mymediaupload.com/Music/Artwork/5051442800128.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>712</td><td>Jingle Bells</td><td>Basshunter</td><td>Xmas</td><td>Music/Basshunter - Jingle Bells (Official Music Video) HQ.mp3</td><td>1</td><td>MMU_Admin</td><td>Unknown</td><td>27</td><td>http://www.mymediaupload.com/img/AlbumR.png</td><td>2010-12-15</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>203</td><td>Now You&#39;re Gone</td><td>Basshunter</td><td>Dance</td><td>Music/Now youre gone.mp3</td><td>1</td><td>MMU_Admin</td><td>LOL (International V)</td><td>37</td><td>http://www.mymediaupload.com/Music/Artwork/5051442800128.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>608</td><td>Now You&#39;re Gone (Dark Intensity Remix)</td><td>Basshunter</td><td>Remix</td><td>Music/Now You re Gone (Dark Intensisty).mp3</td><td>1</td><td>MMU_Admin</td><td>Dark Intensity Remixs</td><td>8</td><td>http://www.mymediaupload.com/Music/Artwork/DarkIntensity.png</td><td>2010-10-01</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>185</td><td>Now You&#39;re Gone [DJ Alex Mix]</td><td>Basshunter</td><td>Remix</td><td>Music/01 Now Youre Gone [DJ Alex Extended</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>30</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>184</td><td>Numbers</td><td>Basshunter</td><td>Dance</td><td>Music/15 Numbers [Hidden Track].mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>106</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>181</td><td>On Our Side</td><td>Basshunter</td><td>Dance</td><td>Music/11 On Our Side.mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>35</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>183</td><td>Plane To Spain</td><td>Basshunter</td><td>Dance</td><td>Music/13 Plane To Spain.mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>48</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>169</td><td>Please Don't Go</td><td>Basshunter</td><td>Dance</td><td>Music/Please Dont Go.mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>25</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>189</td><td>Please Don't Go [Bad Behaviour Remix]</td><td>Basshunter</td><td>Remix</td><td>Music/05 Please Dont Go [Bad Behaviour Re.mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>34</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>321</td><td>Russian Privjet</td><td>Basshunter</td><td>Dance</td><td>Music/Basshunter - Russian Privjet93849.mp3</td><td>1</td><td>MMU_Admin</td><td>LOL (International V)</td><td>71</td><td>http://www.mymediaupload.com/Music/Artwork/5051442800128.jpg</td><td>2010-02-20</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>499</td><td>Saturday</td><td>Basshunter</td><td>Dance</td><td>Music/Basshunter - Saturday1.mp3</td><td>1</td><td>MMU_Admin</td><td>Saturday - EP</td><td>33</td><td>http://www.mymediaupload.com/img/AlbumA.png</td><td>2010-06-14</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>211</td><td>So Near So Close</td><td>Basshunter</td><td>Dance</td><td>Music/05 So Near So Close.mp3</td><td>1</td><td>MMU_Admin</td><td>LOL (International V)</td><td>28</td><td>http://www.mymediaupload.com/Music/Artwork/5051442800128.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>205</td><td>Stay Alive</td><td>Basshunter</td><td>Dance</td><td>Music/Stay Alive.mp3</td><td>1</td><td>MMU_Admin</td><td>LOL (International V)</td><td>43</td><td>http://www.mymediaupload.com/Music/Artwork/5051442800128.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>206</td><td>Tetris</td><td>Basshunter</td><td>Dance</td><td>Music/Tetris.mp3</td><td>1</td><td>MMU_Admin</td><td>LOL (International V)</td><td>32</td><td>http://www.mymediaupload.com/Music/Artwork/5051442800128.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>195</td><td>The Basshunter Song</td><td>Basshunter</td><td>Dance</td><td>Music/The BassHunter Song.mp3</td><td>1</td><td>MMU_Admin</td><td>LOL (International V)</td><td>27</td><td>http://www.mymediaupload.com/Music/Artwork/5051442800128.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>202</td><td>The Night</td><td>Basshunter</td><td>Dance</td><td>Music/The Night.mp3</td><td>1</td><td>MMU_Admin</td><td>LOL (International V)</td><td>54</td><td>http://www.mymediaupload.com/Music/Artwork/5051442800128.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>216</td><td>The Warpzone</td><td>Basshunter</td><td>Dance</td><td>Music/The Warpzone.mp3</td><td>1</td><td>MMU_Admin</td><td>LOL (International V)</td><td>440</td><td>http://www.mymediaupload.com/Music/Artwork/5051442800128.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>207</td><td>Thunder In Paradise</td><td>Basshunter</td><td>Dance</td><td>Music/Thunder In Paradise.mp3</td><td>1</td><td>MMU_Admin</td><td>LOL (International V)</td><td>27</td><td>http://www.mymediaupload.com/Music/Artwork/5051442800128.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>208</td><td>Trance Up</td><td>Basshunter</td><td>Dance</td><td>Music/Trance Up.mp3</td><td>1</td><td>MMU_Admin</td><td>LOL (International V)</td><td>31</td><td>http://www.mymediaupload.com/Music/Artwork/5051442800128.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>190</td><td>Walk On Water [Ultra DJ's Remix]</td><td>Basshunter</td><td>Remix</td><td>Music/06 Walk On Water [Ultra DJs Remix].mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>24</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>209</td><td>Welcome To Rainbow</td><td>Basshunter</td><td>Dance</td><td>Music/Welcome to Rainbow.mp3</td><td>1</td><td>MMU_Admin</td><td>LOL (International V)</td><td>28</td><td>http://www.mymediaupload.com/Music/Artwork/5051442800128.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>210</td><td>Welcome To Rainbow [Hardstyle Remix]</td><td>Basshunter</td><td>Remix</td><td>Music/02 Welcome To Rainbow (Hardstyle Rem.mp3</td><td>1</td><td>MMU_Admin</td><td>LOL (International V)</td><td>28</td><td>http://www.mymediaupload.com/Music/Artwork/5051442800128.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>212</td><td>When You Leave [Numa Numa]</td><td>Basshunter</td><td>Remix</td><td>Music/When You Leave (Numa Numa).mp3</td><td>1</td><td>MMU_Admin</td><td>LOL (International V)</td><td>39</td><td>http://www.mymediaupload.com/Music/Artwork/5051442800128.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>173</td><td>Why</td><td>Basshunter</td><td>Dance</td><td>Music/03 Why.mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>34</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> <tr> <td>192</td><td>Without Stars (Swedish Version)</td><td>Basshunter</td><td>Dance</td><td>Music/09 Without Stars [Swedish Version].mp3</td><td>1</td><td>MMU_Admin</td><td>Bass Generation</td><td>40</td><td>http://www.mymediaupload.com/Music/Artwork/BassGeneration.jpg</td><td>2009-11-13</td><td>No iTunes Link Specified</td><td>0</td><td>0</td><td>1</td><td>NULL</td><td>0</td><td>0</td><td>0</td></tr> </table> I'm sorry if you can't understand what I mean its just I find it hard to explain stuff Hi Guys, actually I'm doing hard with this code. the fact is that Im inserting data (name, phone number, nss) and im doing a select to get the id number where nss is like $nss (. I don`t know why I can`t receive data, i think the fact is that all the code is inside an if statement) But that is why im here guys. In adittion I tryed to get the max id in order to print into mail function. But I couldn't . This is my code...
************************************************************************************************************ //Database connection done perfectly $mysqli = mysqli_connect( "****", "***", "***", "***");
************************************************************************************************************ // Im working with bots and the intent received is this, in addition i get variables correctly.
************************************************************************************************************ //here im inserting the variables in the correct order. The database is getting the values correctly too.
************************************************************************************************************
************************************************************************************************************
//here is the section when im going to select the id from the table, where the nss number is equal to the nss variable number that i've putted (but idk if the insert is done at this point....
************************************************************************************************************ For example i'm getting the mail, the name and lastname correctly from my function (which gets the parameters and turn the information in readable characters to php)
$to = $email; } ************************************CODE DONE ***********************************************************
So guys, Idk what is happening here, I tryed lot of things but when im get the email I dont get the id value..... I think is because the insert hasn't been completed while the if is open..... In adition I wanto to ask you guys if somebody knows how to get correctly the data from this code... Firstly I was trying to get the max id from my table and then plus 1 to increase the number. and in that order put the id by myself or atleast get the value in that way. I tryed closely, but i finish getting the array value.. I going to show my code...
function obtener_Id(){ Hey guys im making a blog and when i make a post it automatically takes the date and created an archive based on what ever i have in the database (date wise) anyways it works almost fine but if i make a date in the same month it duplicates like so: October 2010 October 2010 November 2010 Is there away where i can limit October by 1 but when i come to make a post next year it will still display like so: October 2010 November 2010 December 2010 January 2011 ... October 2011 If i show you the code might make more sense haha:: public function create_archive() { // Loop through the database grabbing all the dates:: $sql = "SELECT blog_date FROM subarc_blog"; $stmt = $this->conn->prepare($sql); $stmt->execute(); $stmt->bind_result($date); $rows = array(); while($row = $stmt->fetch()) { $date = explode("-",$date); $month = date("F",mktime(0,0,0,$date['1'])); $year = $date[0]; $item = array( 'blog_month' => $month, 'blog_year' => $year ); $rows[] = $item; } $stmt->close(); return $rows; } and the sidebar looks like so:: <ul class="sidebar"> <?php $result = $Database->create_archive(); foreach($result as $row) : ?> <li><a href=""><?php echo $row['blog_month'] . " " . $row['blog_year']; ?></a></li> <?php endforeach; ?> </ul> Hope someone can help! |