Jump to content

Search the Community

Showing results for tags 'index'.

  • 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

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


Languages

Found 12 results

  1. Hello, everyone. I'm trying to make web page by using HTMl file, but it seems i have some problems. A person allowed me to download, edit, and use his own HTML file, so i can create my own web page. I dont have programming abilities, but i still can understand some parts of the code. I started adding more pictures to the web page, by increasing the HTML code, but i got problems. To add a new photo, i used copy-paste of the previous code that contains another photo, so i when i used the code to add one more photo, i only changed the name of the photo that have to be shown. But now, when i add one more photo, the page receives one more container container. For example, see the following code: </div> <div class="BlackBox"> <div class="TLDR">HERE I ADD THE TEXT I WANT TO BE SHOWN. </div> <div class="Gallery-Content--mediaContainer"><a name="NAME_OF_THE_PHOTO.JPG"></a> <div class="Gallery-Content--media"> <div class="imageContainer"> <img class="image-thumb" src="./NAME_OF_THE_FOLDER_THAT_CONTAINS_IMAGES/NAME_OF_PHOTO.JPG"/>Full-size image is <a href="./NAME_OF_THE_FOLDER_THAT_CONTAING_IMAGES/NAME_OF_THE_PHOTO.JPG">here.</a> </div> When i want to add one more photo, i will not write new code/newkind of code, i will simply copy and paste the already existing code, and then i will simply change the name of the photo, and will replace the old name with new name, so new photo can be show on the web page. Here is how the original page look like: https://i.imgur.com/Ad3qiAS.png Here is how my page look like: https://i.imgur.com/RkguhC6.png As you can see, in the first photo, all pictures are separated. In the second photo, there are containers. Everytime when i copy and paste the code, new container is added. How to remove these containers?
  2. Ok, I've been having a hard time with this thing. It seems like it should be simple but I keep running into obstacles that I just can't seem to fix. I've got a bunch of files that I want my users to be able to access. There's 2 types (articles, calendars) and each needs to be viewed in 1 of 3 formats (pdf, word, webpage). these files are monthly. So I have the following option boxes - Year, Month, Type, format. User selects and then clicks a button to get the URL link. 2 problems - 1) the extensions of the calendars are .pdf, .docx and .html whereas the article extensions are .pdf, .doc and .htm; 2) the file name format is different - calendar name format is Year Month Calendar.extension - article name is Month Article Year.extension. This is where I'm at codewise so far. <form> Select the year: <select id="myYear"> <option>2018</option> <option>2017</option> <option>2016</option> <option>2015</option> </select> <br><br> Select the month: <select id="myMonth"> <option>January</option> <option>February</option> <option>March</option> <option>April</option> <option>May</option> <option>June</option> <option>July</option> <option>August</option> <option>September</option> <option>October</option> <option>November</option> <option>December</option> </select> <br><br> Select Calendar or Article: <select id="myType"> <option>Article</option> <option>Calendar</option> </select> <br><br> Select PDF, Word or Webpage: <select id="myFormat"> <option>PDF</option> <option>doc</option> <option>htm</option> </select> <br><br> <input type="button" onclick="myFunction()" value="Click Me!"> <br><br> </form> <a id="myLink" href="http://www.myOrg.org/Article/HomePage.htm" target="_blank">Star Homepage and Submission</a> <script> function myFunction() { var Yrsel = document.getElementById("myYear"); var Mnthsel = document.getElementById("myMonth"); var Typesel = document.getElementById("myType"); var Formatsel = document.getElementById("myFormat"); document.getElementById("myLink").innerHTML = "Get Star"; if (Typesel.options[Typesel.value] = "Article") { document.getElementById("myLink").href = "http://www.myOrg.org/Article/" + Mnthsel.options[Mnthsel.selectedIndex].text + " " + Yrsel.options[Yrsel.selectedIndex].text + " Article " + Typesel.options[Typesel.selectedIndex].text + "." + Formatsel.options[Formatsel.selectedIndex].text; } if (Typesel.options[Typesel.value] = "Calendar") { document.getElementById("myLink").href = "http://www.myOrg.org/Article/" + Mnthsel.options[Mnthsel.selectedIndex].text + " Calendar " + Yrsel.options[Yrsel.selectedIndex].text + " " + Typesel.options[Typesel.selectedIndex].text + "." + Formatsel.options[Formatsel.selectedIndex].text; } } </script> </div> </div> It works but I would like to use value instead of Index for the extension (format) options. So I can put something like <option value="htm">Webpage - viewable in browser, not formatted for printing</option>. Of course I would use an if statement to take care of the extra letters in the extensions. However, when I try using the value in the code it doesn't work. Formatsel.options[Formatsel.value].text HELP!!! Why won't the value work? I get a URL of XXXX.undefined
  3. PROBLEM: Turn a two-step SELECT procedure into a one-step procedure. The two-step procedure is 1) Discover with a query to a parent table what other rows in the parent table are related to the queried row. 2) Obtain selected data for the queried row and other related rows from the parent table and a child table that are connected by a FOREIGN KEY. BACKGROUND: I have two tables -- a parent (parent_table) and a child (child_table) table - connected by a valid FOREIGN KEY and an additional table (ref_table) that contains information about the relationship among the rows of both the parent and child tables. Please find below the results of three SHOW CREATE TABLE statements to help you in your understanding of the table structure. In addition, I have included the INSERT statements for the child_table and ref-table. I accidentally destroyed the INSERT statement for the parent_table. This said, the parent and child tables are very similar in structure. DISCLAIMER: Please understand that the problem that I have created is heuristic in nature and is being used to create a prototype for subsequent, more practical use. The PARENT Table parent_table CREATE TABLE `parent_table` ( `id` int(3) NOT NULL DEFAULT '0', `usertype` enum('1','2','3') CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '2' COMMENT '1=good, 2=neutral, 3=bad', `username` char(150) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`,`usertype`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 The CHILD Table child_table CREATE TABLE `child_table` ( `id` int(3) NOT NULL DEFAULT '0', `usertype` enum('1','2','3') CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '2' COMMENT '1=good, 2=neutral, 3=bad', `userbio` varchar(500) DEFAULT NULL, KEY `parent` (`id`,`usertype`), CONSTRAINT `child_table_ibfk_1` FOREIGN KEY (`id`, `usertype`) REFERENCES `parent_table` (`id`, `usertype`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=latin1 INSERT INTO `child_table` (`id`, `usertype`, `userbio`) VALUES ('1', '1', 'I am Roddy.'), ('2', '2', 'I am Beth.'), ('3', '3', 'I am Matt.'), ('4', '3', 'I am Tim.'), ('5', '2', 'I am Tylor.'), ('6', '1', 'I am Liz.'), ('7', '1', 'I am Aldo.'), ('8', '1', 'I am Adzit.'), ('9', '3', 'I am Jason.'), ('10', '3', 'I am David.') The REFERENCE Table ref_table CREATE TABLE `ref_table` ( `ref_id` int(3) NOT NULL DEFAULT '0', `id` int(3) DEFAULT NULL, `ref` int(3) DEFAULT NULL, `count_ref` int(1) DEFAULT NULL, KEY `par_ref` (`ref_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 INSERT INTO ref_table (ref_id,id,ref,count_ref) VALUES ('1','1','2','1'), ('2','1','6','2'), ('3','1','7','3'), ('4','2','6','1'), ('5','2','9','2'), ('6','4','1','1'), ('7','4','2','2'), ('8','4','6','3'), ('9','4','10','4'), ('10','5','6','1'), ('11','6','1','1'), ('12','6','2','2'), ('13','6','9','3'), ('14','7','5','1'), ('15','7','6','2'), ('16','8','1','1'), ('17','9','10','1'), ('18','10','4','1'), ('19','10','6','2'), ('20',10, NULL,'1'); EXPLANATION BY EXAMPLE: Say a user is interested in row 4 of the parent_table. When the database is queried a SELECT JOIN statement looks in the id field of the ref_table and finds four corresponding rows identified by ref_id 6, 7, 8, and 9. With each of these latter rows is associated a different row -- namely, 1, 2, 6, 10. Without further selection is returned all of the information contained in the parent_table and child_table associated with rows 1, 2, 4, 6, and 10. This is what is supposed to happen, but does not. The REJECTED SQL STATEMENT SELECT * FROM parent_table OUTER JOIN child_table ON parent_table.id = child_table.id OUTER JOIN ref_table ON parent_table.id = ref_table.id QUESTION ONE: Does the table structure make sense? Are the constraints properly set? QUESTION TWO: Why is my SQL statement rejected as poorly formatted? This is my first attempt to use the JOIN clause. So, please be as thorough with your answer as possible. I must believe that I have a long road ahead with MySQL and should prepare for it as i move forward. Roddy
  4. How to get an array index by its value (key)? Is there a special function for that in PHP? For example, I have an array $a ["zero","one","two"] and a variable $b = "two", I know the value is in the array, but I don't know its index.
  5. Hi everyone. So I am have an issue to were I am trying to send information to my database and I get this error: NOTICE: Undefined index This is the code I am using: index.php <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Test Page</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <form action="signup.php" methos="POST"> <input type="text" name="first" placeholder="First Name"><br> <input type="text" name="last" placeholder="Last Name"><br> <input type="text" name="uid" placeholder="Username"><br> <input type="password" name="pwd" placeholder="Password"><br> <button type="submit">SIGN UP</button> </form> </body> </html> signup.php <?php include 'dbh.php'; $first = $_POST['first']; $last = $_POST['last']; $uid = $_POST['uid']; $pwd = $_POST['pwd']; $sql = "INSERT INTO username (first, last, uid, pwd) VALUES ('$first', '$last', '$uid', '$pwd')"; $result = mysqli_query($conn, $sql); ?> dbh.php <?php $conn = mysqli_connect("localhost", "root", "", "logintest"); if (!$conn) { die("Connection failed: ".mysqli_connect_error()); } ?> So this is the code I am using. I know it is connecting to the database because the PRIMARY KEY is entering without an issue but the information is now being filled in. I.E. First name, Last name, User, and Password. If anyone can help me that would be great.
  6. j.silver

    Index vs Key

    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.
  7. I am creating a table using phpMyAdmin. I would appreciate if someone would explain: In the collation, I am selecting utf8_general_ci. Is this OK? For indexing, when should I use ''unique and when would I use 'index'?
  8. Hello, To start, sorry for my english i'm French ^^ I have a problem, in fact I can't retrieve the index of the row in a table. I tried many things but I haven't found the solution. Here is my code: <script id='TableSuser'> var oTableSuser = new sap.ui.table.Table({editable:false, width: "400px", visibleRowCount:2}); var oControl = new sap.ui.commons.Button({text : "{suser}", press : function() {openDialog(oTableSuser.getSelectedIndex());}}); oTableSuser.addColumn(new sap.ui.table.Column({label: new sap.ui.commons.Label({text: "Suser"}), template: oControl, sortProperty: "Button", filterProperty: "Button", name: "password_colonne"})); oControl = new sap.ui.commons.TextView({text:"{suser_mdp}"}); oTableSuser.addColumn(new sap.ui.table.Column({label: new sap.ui.commons.Label({text: "suser_mdp"}), template: oControl, sortProperty: "suser_mdp", filterProperty: "suser_mdp", visible: false})); var oModel = new sap.ui.model.json.JSONModel(); oModel.loadData("suser.php"); oTableSuser.setModel(oModel); oTableSuser.bindRows("/"); function openDialog(index) { var currentRowContext = oTableSuser.getContextByIndex(index); var valeur_suser_mdp = oModel.getProperty("suser_mdp",currentRowContext); alert(index); alert(currentRowContext); alert(valeur_suser_mdp); oTableSuser.getColumns()[1].setVisible(true); }; oTableSuser.placeAt("suser"); </script> I would like to retrieve the index of the row when I call the function function() {openDialog(oTableSuser.getSelectedIndex());} I tried different things and I didn't find how to retrieve the index of the row, I always have "-1" If someone has an idea I'm interested? Thx
  9. Does Anybody knows how to do the following,API's and Indexes etc?CREATE TABLE ¿tUSER¿ ( ¿id¿ bigint(20) NOT NULL AUTO§INCREMENT, ¿id§number¿ varchar(20) NOT NULL, ¿first§names¿ varchar(100) NOT NULL, ¿last§name¿ varchar(100) NOT NULL PRIMARY KEY (¿id¿), <<INDEXES>>)CREATE TABLE ¿tPROFILE¿ ( ¿id¿ bigint(20) NOT NULL AUTO§INCREMENT, ¿tUSER§id¿ bigint(20) DEFAULT NULL, ¿tTYPES§id¿ bigint(20) DEFAULT NULL, ¿value¿ varchar(100) NOT NULL, PRIMARY KEY (¿id¿), <<INDEXES>>)CREATE TABLE ¿tTYPES¿ ( ¿id¿ bigint(20) NOT NULL AUTO§INCREMENT, ¿type¿ varchar(100) NOT NULL DEFAULT '', ¿description¿ varchar(255) NOT NULL, ¿deleted¿ tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (¿id¿), <<INDEXES>>) Apply indexes to the above tables, and design a SINGLE query to retrieve a full list of user information based on: 2.A) an ID number 2. a cellphone number (¿Cellphone¿ is a record in the ¿tTYPES¿ table)3. Write a re-usable script for importing information into the above 3 tables, from the example dsv file below: - NB - All data of the same type MUST be stored in the same format - NB2- You may assume that if a column doesn't seem to exist for a piece of data, that data type is listed in the tTYPES table<<BOF>>record§numberöid§numberöfirst nameölast nameömsisdnönetworköpointsöcard numberögender312ö9101011234011öTest JunioröSmithö071 123 4321öMTNö73ö1241551413214444öM313ö9012023213011öBoböSmithö27743334321öVodacomö3ö1231233232323244öM314ö8706055678011öFranköFrankinsonö2771 156 1567ö8taö0ö1231123453214444öM315ö9102078765011öMaryöVan Niekerkö+27(0)711236677öCellCö2ö1278933213214444öF316ö9005074545011öSusanöWilsonö0821121124öCellCö705ö1231233216544444öF317ö9101013232011öKatherineöJeevesö+271233214ö8taö112ö1231233678214444öF318ö9101011234011öMatthewöMatthiasö0711111111öMTNöö1231555213214444öM319ö9103126666011öMichaelöBayö085-6122-161ö8taö63ö1231244413214444öM320ö7506023232300öTyroneöOlivierö711234322öCellCö89ö1234563213214444öM321ö8901020304055öBurtöJacksonö071 4566544öVodacomö1ö4567233213214444öM<<EOF>>4. After the data has been imported, Write a basic API to wrap the Database. Include the following function points: - Add a new User - Update a User's details - Delete a User - Search users5. Describe what the following bash statement does: grep ¿date +%Y-%m-%d --date='1 day ago'¿ /path/to/file/FILE§PREFIX§Ö¿date +%Y%m%d --date='1 day ago'¿.dsv ö grep -v 'ERROR' ö cut -d "ö" -f 2 ö sed 's/Ü0/27/'------------------------------------------------PART II: Interesting Stuff------------------------------------------------1. If a resturaunt serves: - 3 types of starters - 5 types of main - N types of drinks - 3 types of desserts + How many different meals are available, if you can order 1 item of each type? + How many different meals are available, if you can order 1 item of each type, BUT you can order 2 drinks as long as you do not order the same drink twice? + How many different meals are available, if you can only order a dessert OR a starter?2. If you need to profile 1000 users, each with 3 different attributes, and each attribute has 4 possible values - before parsing any of the date: + What can we guarantee about the resultset?3. A wild director appears. He uses "I want to profile my user database using an additional attribute!" - Describe a ¿super-effective¿ method which we can implement, which will allow us to handle an indeterminate number of this type of request.4. If we have two seperate tables, the first detailing a list of registered club members, and the second detailing a list of competition entrants (assuming we have a key we can join on), what do/could the following resultsets represent: - The INTERSECT of the tables - The MINUS of the tables - The UNION of the tables
  10. Hey guys, I have the following problem: On my blog (http://nachdenkblog.tumblr.com) I want to make it possible to switch directly between the blog entries.At the bottom of the main site you can see pagination between the sites. (BTW, it's in German but I guess you see what it means.) But if you open a specific entry you can see a similar but smaller footer without links to click.The code I used for this is the following: {block:PermalinkPage} <div class="FUSSBEREICH PERMA"> <div class="SCHATTEN"> </div> <div class="FUSS"> <div class="NAVIGATION"> {block:Pagination} <ul> {block:PreviousPost} <li> <a href="{PreviousPost}"> Vorheriger Eintrag </a> </li> {/block:PreviousPost} {block:NextPost} <li> <a href="{NextPost}"> Nächster Eintrag </a> </li> {/block:NextPost} </ul> {/block:Pagination} </div> </div> </div> {/block:PermalinkPage} (In case you need to know: FUSSBEREICH = footer; SCHATTEN = shadow; FUSS = foot)But as I said, no link at all is displayed. Can someone tell me why? Regards,Thomas
  11. dmallia

    content script

    I would like to do a script that includes content from pages according what the user chooses. Example If the users chooses Contact us from the menu I would like to have the index page displayed with the contact us content( www.website.com/index.php?page=contact-us ). I know it is done by GET requests but don't know how to do it or what is it called. Does anyone have a script or a tutorial on how to do it? Or at lest what is it called so I find a tutorial. Thanks before hand.
  12. Hello W3S... what im trying to do here is to call a function that have some div's in it...and here is my code im using for this: <center><div id="content_body"><center><!--/**********************/--><div class="content_left"><?phpecho full_width_auto_begin_box("Latest News");include ("mods_content/index/news.php");echo full_width_auto_end_box();?></div><!--/**********************/--><div class="content_right"><?phpecho full_width_auto_begin_box("Stats");include ("mods_content/index/stats.php");echo full_width_auto_end_box();?></div><!--/**********************/--></center></div><div class="clear"></div></center> and as you see, then i also added a div class called clear at the end... but it still is confucing somehow... so here is my functions code below: /*Inner (Box auto_100%) Mod Function*/function full_width_auto_begin_box($caption = ""){$begin = "<div class='100_auto_box_background'><div class='100_auto_box_title'><b>".$caption."</b></div><div class='100_auto_box_content'>";return $begin;}function full_width_auto_end_box(){$end = "</div><div class='100_auto_box_footer'><a href=''>To Top</a></div></div>";return $end;}/*Inner (Box auto_100%) Mod Function*/ and below here is my .CSS...: /*CLASSES*/.clear {clear:both; /*SKAL HAVE EN START/###### DIV MED CLASS CLEAR FOR AT FOOTEREN IKKE IRITERRE FLOATSNE...*/}/*CLASSES*//*BOX auto_100% CSS*/.100_auto_box_background {width:100%;background-color: #808080;text-align:left;}.100_auto_box_title {width:auto;background-color: #616161;background-image:url(images/backgrounds/tables_titles/black_1.png);background-size:contain;text-align:left;font-size:20px;}.100_auto_box_content {padding:10px;width:auto;height:auto;background-color: #808080;text-align:left;}.100_auto_box_footer {width:auto;background-color: #616161;background-image:url(images/backgrounds/tables_titles/black_1.png);background-size:contain;text-align:center;}/*FOR THE LINK DECORATION IN THE BOX FOOTER...*/.100_auto_box_footer a:link { /*unvisited Links*/color:#990000;text-decoration:underline;}.100_auto_box_footer a:visited { /*Visited Links*/color:#990000;text-decoration:underline;}.100_auto_box_footer a:hover { /*mouse over link*/color:#990000;text-decoration:underline;}.100_auto_box_footer a:active { /*selected link*/color:#000000;}/*FOR THE LINK DECORATION IN THE BOX FOOTER...*//*FOR THE LINK DECORATION IN THE BOX CONTENT...*/.100_auto_box_content a:link { /*unvisited Links*/color:#900;/*background-color:#333333;*/border: 1px solid #990000;}.100_auto_box_content a:visited { /*Visited Links*/color:#900;}.100_auto_box_content a:hover { /*mouse over link*/color:#900;background-color:#333333;}.100_auto_box_content a:active { /*selected link*/color:#900;}/*FOR THE LINK DECORATION IN THE BOX CONTENT...*//*BOX auto_100% CSS*/ hoping someone can help me :/... Note that this is when im trying to make 2 things between each other... but when im putting it right under each item like so below: <center><div id="content_body"><center><!--/**********************/--><?phpecho begin_box("Latest News");include ("mods_content/index/news.php");echo end_box();echo "<br />";echo begin_box("Stats");include ("mods_content/index/stats.php");echo end_box();?><!--/**********************/--></center></div></center> and that is without a clear/both...ideas?...
×
×
  • Create New...