Jump to content

snakez

Members
  • Posts

    10
  • Joined

  • Last visited

snakez's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Ey im just a newbie to php/mysql... i just like to ask a question regarding the sample queries below if i can assign/store a single variable to all of it and how to do it.Insert Into Mytable1(fname,lname) values('nick','smith')Insert Into Mytable2(ProdID,ProdName) values('01','PC')Insert Into Mytable3(ORno,Date) values('01','01/01/01')
  2. I dont reli know what is going on now with the code... i just can't really figure it out coz this is not actually my own scripts/codes. Im just an OJT actually in a particular company and they assigned me to edit the scripts/codes of their online request form. My head is spinning round here coz I can't even trace it.Thanks anyway for your help... perhaps your suggestions and ideas are really useful but i just dont know how coz Im not really familiar with php/myqsl/ajax/javascript... They just let me edit/update the codes of their online request form without even teaching me the background of it. They just only say just have a self study on it and if there's any problems, just "Google it!!!". Well anyway, they're right coz anything can be found in google(but not everything I think so). I will not bother you anymore about this problem... i'l just try to find it out myself.... there's just only one last thing I need you to help me:Where can I find some other sources or tutorials about php/javascript/mysql/ajax or any related to it?Well(I know!), w3schools is really great source/tutorials but i need other sites aside from it... those that can really help me easily to understand the way it is.
  3. I added this code below also into the javascript codes.... PartText[0].value ='<?=$partname?>'PartText[1].value ='<?=$partnumber?>'PartText[2].value ='<?=$version?>' Same thing happens.... Still "Array" strings are the one that was saved into the database, not the real value that i inputted to the elements.
  4. These are the changes i've made to my code during my 1st post above.This is the part in javascript code that was changed: PartText[0].name = 'partname[]'PartText[1].name = 'partnumber[]'PartText[2].name = 'version[]' And this is the part in html/php code that was changed: Part Name: <input type="text" class='bginput'name="partname[]" id="part1" value='<?php=$partname?>'/>Part Number: <input type="text" class='bginput' name="partnumber[]" id="part1" value='<?php=$partnumber?>'/>Version: <input type="text" class='bginput' name="version[]" id="part1" value='<?php=$version?>'/> This is the code i've made also to get the value inside the array: $partname=$_POST['partname'];$partnumber=$_POST['partnumber'];$version=$_POST['version']; Primarily i have a set of 3 elements(partname,partnumber,version), then i added a button to add another set of 3 elements as many as i can. I have the submit button also to save and post all the values inputted from the set of 3 elements or another sets, all of them. Now, regarding the code above, whatever strings i am going to input to the set of elements(partname,partnumber,version) or to another set of elements, after i clicked submit button, only 1 set of 3 elements was save in the databse and another thing is that the string that was saved to each element in the database is "Array". That was also the string that is being outputted.Can you explain it to me why? maybe there is really something wrong with my code...
  5. justsomeguy,Thanks for some suggestions of using php scripts. By the way, I already change the name of my elements into partname[],partnumber[],version[]. I also get their array from $_POST['partname'] $_POST['partnumber'] $_POST['version'] respectively. However, i still get the same results. Perhaps you're right of what you have stated above, maybe i'm just an idiot(not reli ) of getting the code well done directly. Is there still any wrong with the code i've edited?
  6. Hey, Im gonna need ur help guys... As you can see, I have here the codes below(pls never mind about my coding, im just a newbie ). Well anyway by default I have an array of elements in which I am supposed to save it to the mysql database using PHP. Now i have created a command button("Add Part") in which i can add another array of elements as many as i want. The problem is that whenever i tried to add another array of elements, whatever the last array of elements i have added, that was the only array of elements that will be saved to the database when I finally clicked the submit button. The rests... well i dont really even know where they gone . I hope you can help me with this guys...Will you pls give me also some tips on what should be the appropriate query for this to save all the array of elements to the DB and some tips also on what should be the right code to display the output of array of elements on a page? Here is my code in javascript.... function addPart() { var tbl = document.getElementById('myTable') var nRow = tbl.rows.length - 13 var row = tbl.insertRow(nRow) var blankCell = row.insertCell(0) var addCell = row.insertCell(1) var PartText = new Array(2) var Append = addCell.appendChild var Caption = document.createTextNode for(var i=0;i<=2;i++) { PartText[i] = document.createElement('input') PartText[i].type = 'text' PartText[i].id = 'part' + nRow } PartText[0].name = 'partname' PartText[1].name = 'partnumber' PartText[2].name = 'version' blankCell.bgColor="#f1f1f1" addCell.bgColor="#f1f1f1" Append(Caption('Part Name: ')) Append(PartText[0]) Append(Caption(' Part Number: ')) Append(PartText[1]) Append(Caption(' Version: ')) Append(PartText[2]) }</script> Here is my code in html with the php values.... <tr><td bgcolor='#f1f1f1'></td><td bgcolor='#f1f1f1' align='left'> Part Name: <input type="text" class='bginput'name="partname" id="part1" value='<?=$partname?>'/> Part Number: <input type="text" class='bginput' name="partnumber" id="part1" value='<?=$partnumber?>'/> Version: <input type="text" class='bginput' name="version" id="part1" value='<?=$version?>'/></td></tr><tr><td bgcolor='#f1f1f1'></td><td bgcolor='#f1f1f1' align='right'> <input type="button" value="Add Part" onclick=addPart() /> <input type="button" value="Cancel" onclick=delPart() /></td></tr> Tnx in advance guyz... I hope you could give some ideas...
  7. Alright i'll try that one, tnx...
  8. Yes, actually i used php script to communicate with my MySQL DB. it runs on an apache server. I just dont know how to get the value from the promptbox and store it to the Database. I would like some suggestions also if you guyz have any other way aside from inputting from the promptbox wherein I can add or input a new value and store it directly to the databse?
  9. Hey guyz help me pls with this problem... im only new to javascript and also to the opensource like(php and mysql). I tried to use a prompt box and store the value into the textbox. But now I want to know how to insert/add the value inputted from a prompt box directly into the mysql database if it is possible.
×
×
  • Create New...