Search the Community

Showing results for tags 'Table'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


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


  • Community Calendar




Website URL








Found 64 results

  1. In phpmyadmin I did the following query and had it output in php like this: $sql = "UPDATE `table` SET count = count + 1 WHERE unique_nr = 5175781"; this all worked well. though when I tried to implement it in my script I had an error: script: <?php // code to establish dbase connection: var_dump($unique_nr); // $stmt = $conn->prepare('UPDATE table SET count = ? WHERE unique_nr = ? '); $stmt = $conn->prepare('UPDATE table SET count = count + 1 WHERE unique_nr = ? '); $stmt->bind_param("is", $count, $unique_nr); $stmt->execute(); ?> resulting in an error message. I also tried this way of writing for bind_param: $stmt->bind_param("s", $unique_nr); but that didnt update the column, though there wasnt an error message anymore
  2. Hello, I have the following tables: CustomerPersonalDetails ID, Name, Surname, etc. CustomerAccountDetails ID, UserName, Password, ApplicationDate, RegistrationDate with single and original data, and CustomerEconomicOverview ID, + Fields with Calculated Data ​Custo​merBehaviourOverview ID, + Fields with Calculated Data with single and calculated data. They all are connected with 1:1 relation. I would like to ask what the suggestable practice is; to keep the data grouped and separated like above or to put them all in one table. Also, my intention is to encrypt all original data. Thanks in advance.
  3. Hello, I have Events and Tickets​ tables. In Tickets table I have at least the following fields: EventsID CustomersID​ TicketNo ... The number of tickets for an event varies between 500-20,000. That means the number of records after 100 events may be 50,000-2,000,000. I wonder if it is better for each event to have a different table, which means I have 100 tables with 500-20,000 records in each. Which design is better for selecting/querying customers records? Thanks in advance.
  4. Dear all, I am trying to dig into the exact difference between key and index in MySQL tables. Some say they are synonymous, others give some differences. I still don't feel confident enough to decide when to use each on a table. I would appreciate if someone well-versed in their difference explain such difference and when to use each. Thanks.
  5. Hi, im a little bit struggling here. What I am trying to do is read the content from a Table by reading the number of rows and cells,(later on only selected rows by checkbox) then display the data in a ´generated Table (where i have to add cells with inputfields) So now my question is: How do i have to write the code so the first row will be created with <th> instead of <td> ? How to add input fields to the cells ? (actually they all could be input fields, just filled out with the data from the table i read from and blank fields for the added or so on.) function generate_table() { // get the reference for the body var body = document.getElementsByTagName("body")[0]; var x = document.getElementById("TableB").rows.length; var y = document.getElementById("TableB").rows[0].childElementCount; var z = document.getElementById("TableB").rows[1].cells[3].innerText; alert("x="+x +" y="+y+" z="+z); // creates a <table> element and a <tbody> element var tbl = document.createElement("table"); var tblBody = document.createElement("tbody"); // creating all cells for (var i = 0; i < x; i++) { // creates a table row var row = document.createElement("tr"); alert("ROW"+row); for (var j = 0; j < y; j++) { // Create a <td> element and a text node, make the text // node the contents of the <td>, and put the <td> at // the end of the table row var cellText = document.createTextNode("cell in row "+i+", column "+j); if (row.tabIndex[0]){ var cell = document.createElement("th"); cell.appendChild(cellText); row.appendChild(cell); } else{ cell = document.createElement("td");} cell.appendChild(cellText); row.appendChild(cell); } // add the row to the end of the table body tblBody.appendChild(row); } // put the <tbody> in the <table> tbl.appendChild(tblBody); // appends <table> into <body> body.appendChild(tbl); // sets the border attribute of tbl to 2; tbl.setAttribute("border", "2"); tbl.setAttribute("class", "tableTest"); }
  6. Desperately needed: a way to retrieve all records from a database table while using prepared statements. The script now works but only for 1 record. <?php $_POST['id']= '2'; // set connection variables // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $stmt = $conn->prepare("SELECT * FROM table WHERE id LIKE ? ;"); if ( !$stmt ) { yourErrorHandler($conn->error); // or $mysqli->error_list } else if ( !$stmt->bind_param('i', $id ) ) { yourErrorHandler($stmt->error); // or $stmt->error_list } else if ( !$stmt->execute() ) { yourErrorHandler($stmt->error); // or $stmt->error_list } else { $result = $stmt->get_result(); while ($row = mysqli_fetch_assoc($result)) { var_dump($row); $data[]=$row; var_dump($id); var_dump($data); $array= implode("|" , $row) ; var_dump($array); foreach( $data as $row ) { $id = $row['id']; $name = $row['name']; var_dump($id); var_dump($name); } } } ?> I hope someone can give a query that executes what is desired, but maybe there is also a possibilty to put the query in a loop? Please help.
  7. Hi Guys, I have a slight problem with some of my code. I have a series of tables running down a page with each table containing different data. All looks fine when I look at it as a HTML page but when I use it as an Email 2/3 elements move for some reason, is there a way I can make sure these elements won't move? The code is in the backend of a program I use and gets called as Emails are generated for different subjects. Thanks in advance, Craig.
  8. I have a table which is either empty or has 1 record If the table is empty i cant retrieve info from the database and get an error message. my code: $sql = "SELECT id FROM users WHERE id = (SELECT MAX(id)FROM users)"; $result = $conn->query($sql); foreach ( $conn->query($sql) as $row ) { $id = $row['id']; the for each line gives an error message: how to solve this?
  9. In PHPmyadmin I can't move the position of the columns. So when I go to change/modify (not sure how it's called in English) I get the possibility to move column and the place it after another column then where its placed now. Though, it does print the query it goes like ALTER TABLE `my_tab` CHANGE `col1` `col1` TINYINT(1) NULL DEFAULT NULL AFTER `col5`; I have not tested in the mysql console, but in PHP the columns don't move (anymore) like they did do beforehand.
  10. Hello, i am currently using this to make my table appear in the center.<table align="center">...When i look, it works, but the validator suggests to use CSS. I have tried some things like:<table style="align:center"><table style="text-align:center">But none of them seem to work. What am i doing wrong?Thanks in advance! =D
  11. So my goal is now to have a table list read from the database. The content of the table is supposed to be put in an <SELECT> <OPTION VALUE> form for a dropdown menu having the user select only 1 value. $conn = new mysqli($servername, $username, $password, $dbname); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SHOW TABLES"; if (!$result = $conn->query($sql)){ die('There was an error running the query[' .$conn->error. ']'); } foreach($row = $result->fetch_assoc()){ echo "<center>"; $reeks = implode(" " , $row); // echo $reeks; // echo "<br>"; echo "</center>"; ?> <center> <form name = "inpform" method="post" action="Add-succ7.php"> <SELECT > <option value = "<?php echo $reeks; ?>" > </option> </SELECT> </center> <?php } mysqli_close($conn); ?> Do I have to do this with foreach or while? (or something else?) In the checkbox version I use while but when doing that I get a list of 8 checkboxes without any value. I see the dropdown menu is placed in the loop of while so another condition (like foreach) seems to be the first thing to think about. But what kinda solutions would you have for the script above?
  12. which query should be used when you have this INSERT INTO `$variable` (col1, col2) VALUES ..... The question is regarding $variable. is it " ", ' ' ,` ` . ?
  13. i found this script online: <?php $conn = new mysqli('localhost', 'username', 'password', 'database') or die ('Cannot connect to db'); $result = $conn->query("select id, name from table"); echo "<html>"; echo "<body>"; echo "<select name='id'>"; while ($row = $result->fetch_assoc()) { unset($id, $name); $id = $row['id']; $name = $row['name']; echo '<option value="'.$id.'">'.$name.'</option>'; } echo "</select>"; echo "</body>"; echo "</html>"; ?> But what I want is to get the table names from the database. Does anyone know how?
  14. Unknown column 'col' in 'field list' Is the error message, i tried all kinds of backticks, and quotes but doesnt work So I was thinking, how can I check (in phpmyadmin or in the mysql console) whether a table has the columns that are needed?
  15. I have a script and a MYSQL query its supossed to create a new table $variable now I have $sql = "CREATE TABLE '$variabele' "; But it doesnt work. I think CREATE TABLE works for constants not for variables. Which query should I use?
  16. Hello! I have a map in my website and when I click on it, if there is a feature, it shows its information. This information is written by an innerHTML and currently it looks like that: if (feature) { var objeto = feature.getProperties(), propiedades; var propiedades; content.innerHTML = ""; for (propiedades in objeto){ content.innerHTML += propiedades + ':' + objeto[propiedades] + "<br />"; } return = 'block'; } else { return = 'none'; } So the info is shown ok but a little untidy. So I would like to show this info with a table. propiedades contains the name of the data and objeto[propiedades] their values. Could anybody tell me how to do it or give me an example please? Thank you in advance!
  17. Suppose I have a table in mysql server database and I want to add a row that fits these piece of information username = john password = silverlight is it true if I do it like this : INSERT INTO table (username , password) values ('john' , 'silverlight'); ?? this is the first question the second question is : are these two the same ??? INSERT INTO table (username , password) values ('john' , 'silverlight'); // without single quotes INSERT INTO table ('username' , 'password') values ('john' , 'silverlight'); // with single quotes if not what is the difference ?
  18. I'm having a thing I cant figure out in CSS I defined a class to make a table. The idea is that the table will be filled with text and its added frequently. The bottom border of the table should add a new line and augment. I tried several things, I also tried overflow-x auto, but I dont want a scrollbar. Is there a way to get rid of that scrollbar. Im using CSS3 It would be great if someone has a solution.
  19. Hello..Can someone please teach me how to change the <table> tag into <div> tag without changing the table style..I heard that <div> tag is more friendly than <table>.. Please give me an example.. Thank you..
  20. Hi, I am building my first web site & very new to html code etc.... One problem I can't seem to solve is that in my site I have two tables next to each other. One floating right & one floating left. They are different heights & will fluctuate in content over time as they contain variable information. Under the two tables I have a <p> footer with some text in it. I can sometimes get the text in my web editor (web expressions 4) to span the page & sit under both tables, but this never works in all browsers when I preview it. Some let the text float up under the shorter table & some span the text at a random point? What is the best code to allow text to always span the page & not float up, but at the same time be responsive to the changes in the tables heights? Have tried divs, breaks & lines but without success in chrome/IE/firefox (using eric meyers css/reset as well to null any variables). Thanks. PS: w3sch is an excellent resource.....
  21. Hello, I have been researching a question I have but cant seem to find an answer for my situation. I have a simple html form that in a couple of fields may require user to write a longer then usual response on the trouble she is experiencing. What I would like is for that table cell to abbreviate the text and I have a link (called More) to the full page for that indivual row which can display the whole trouble report. Right now the whole text appears in the table cell and distorts the display. Is there a way to do this. Thanks. Here is the code for the table. It is the row with 'Problem' variable I would like to abbreviate. <table class="table table-striped table-bordered table-hover" cellpadding="10" cellmargin="5" border="3"> <tr> <th id="table_header">First Name</th> <th id="table_header">Last Name</th> <th id="table_header">Reach #</th> <th id="table_header">Room Number</th> <th id="table_header">Type of Trouble</th> <th id="table_header">Room Availability</th> <th id="table_header">Trouble Report</th> <th id="table_header">Ticket Status</th> <th id="table_header">Assignment</th> <th id="table_header">TT Number</th> <th id="table_header"></th> </tr> <?php foreach($model as $row) { echo "<tr class='success'>"; echo '<td>'. $row['FName'] .'</td>'; echo '<td>'. $row['LName'] .'</td>'; echo '<td>'. $row['Rch_Num'] .'</td>'; echo '<td>'. $row['Rm_Number'] .'</td>'; echo '<td>'. $row['Prob_Cat'] .'</td>'; echo '<td>'. $row['Rm_Avail'] .'</td>'; echo '<td>'. $row['Problem'] .'</td>'; echo '<td><i>'. $row['Tkt_Status'] . '</i></td>'; echo '<td>'. $row['Assgnd_Tech'] .'</td>'; echo '<td>' . $row['TT_Num'] . '</td>'; echo "<td class='info'><a class=one href='tt_record.php?id=" . $row['id'] . "'>More...</a></td>"; echo "</tr>"; }?></table>
  22. I wonder if anyone here can help me... I am having troubles with the table code. It is messing with other elements on my page. Does anyone know how I can fix it so that it only adds a border to the sections I want to have borders and not to everywhere on the page? Every time I add html code bits to my page to create these: It makes the Header look like this: When it is supposed to look like this: *I use weebly as my website building platform, so the elements in the first picture above was created with the custom element tool. Each product block is a single cell table, and this is the code I am using for each product block (apart from a few URLs and Text, etc... each one is the same): <!DOCTYPE html> <html> <head> <style> table, th, td { border: 2px solid #DCDCDC; padding: 1px; } table { border-spacing: 1px; } th, td { padding: 5px; } a { text-decoration: none; } p.small { line-height: 60%; } </style> </head> <body> <table style="width:100%"> <tr> <td><div align="center"> <a href=""><img src="" alt=”Happily Ever After Fashion Doll Crochet Pattern PDF $10.00 by Rebeckah’s Treasures - You can be a designer too when you mix and match necklines & silhouettes! Grab your copy today here: #crochet #pattern #barbie #toys” border="0" width="100%" style="margin:3px 0px"/><h4 style="margin:0px 0px">"Happily Ever After"</h4><h5 style="margin:0px 0px">Crochet Pattern</h5></a> <p class="small" style="margin:0px 0px"><em> $10.00 USD</em></p> <a href="#" onclick="R.cart.add(36645, 220124); return false;"><img src="" border="0" width="120"style="margin:0px 0px"/></a></div></td> </tr> </table> </body> </html> Thanks in advance!
  23. Hello, MyProject I am having a hard time making the form inputs align with the localstorage table. The forms will have to fit in between the ID and ACTIONS columns and align with where the data is being inputted. I also am having a hard time setting the widths for the table columns. Adjusting the padding is not a problem, but setting a set width is a problem. Any help would be greatly appreciated. Also, is there any way to change the local storage ID something like GW-"DATE"-"TIME" rather than numerically going up 1-2-3-4-5-etc.? Thank you, I SIDEARM I
  24. Hello everybody, I've created a table in HTML and while layout and styling with CSS is working nicely, the text of the first cell is very slightly shifted towards the bottom and therefore not aligned with the rest of the text in the other cells. What is the reason for this and how can this issue be solved ? Thank you very much in advance !
  25. Hello everyone, I am facing an issue with a page containing a table and a form : the form does not take over the style defined in the style sheet. It work out fine once I omit the closing </table>, however in that case the order of the elements gets messed up. What can I do to fix this ? Here is the code (I've taken out several irrelevant elements (additional list items, metas, etc.) : <!DOCTYPE html> <html> <head> <meta charset="iso-8859-1" /> <title>HIGHWAY - Hard Rock'n'Roll</title> <link rel="Shortcut icon" href="favicon2.ico" type="image/x-icon"> <link rel="stylesheet" type="text/css" media="screen" href="styles.css"> <style> ul {list-style-type: none; margin: 0; padding: 0;} li {display: inline;} </style> </head> <body style="background-color:#000"> <center> <img src="logo_entete.jpg" alt="Logo Highway" style="width:700px; height:196px;"><br/> <br/> <br/> <!-- Site navigation menu --> <nav> <ul> <li><a href="news_fr.html">★ NEWS</a></li> <li><a href="band_fr.html">★ BAND</a></li> </ul> </nav> <br/> <!-- Main content --> <h1 style="text-align:left">CONTACT</h1> </br> <table> <tr> <td><u>Booking (France)</u><br/><br/> HIGHWAY Corp.<br/> 128 Place du Quebec, Appt 36<br/> 34000 Montpellier - France<br/> Email :<br/> Téléphone : +33 6 29 37 93 57 </td> <td><u>Booking international (hors France)</u><br/><br/> Big Noise Productions<br/> Christina Guntert<br/> Email :<br/> Téléphone : +33 6 43 58 53 29<br/> </br> </td> <td><u>Technicien son</u><br/><br/> Adrien Lagarde<br/> Email :<br/> Téléphone : +33 6 48 55 29 59<br/> </br> </br> </td> </table> <p class="section_form" align="left"> <form action="" method="post" enctype="text/plain"> Abonnez-vous à la newsletter : <input type=text name:mail value="Votre adresse email"> <input type="submit" value="S'abonner"> </form> </p> <br/> <!-- Footer --> <p class="footer">© Highway Corp. 2014</p> </body> </html>