Jump to content

CB150Special

Members
  • Content Count

    39
  • Joined

  • Last visited

Community Reputation

0 Neutral

About CB150Special

  • Rank
    Member
  1. As PHP is an interpretive language, I would have assumed it would. I presume there is no code that can do this? Dbase had a great feature & (eg &string) which meant that the string was actually code. Clipper even compiled the & parameter correctly into making a exe. Guess it depends how clever the code writers are.
  2. I need all 60 columns. There can be 60 different entries per record. I suppose the easiest way is to do something like this and the copy and paste the echo into the bind_param line. for ($i = 2; $i <31; $i++){ $raceclassname = $raceclassname.',$raceclassname'.$i; $bikeID = $bikeID.',$bikeID'.$i; } echo $raceclassname.','.$bikeID;
  3. This is messy but looks like it can work. Not working as yet though !!! Call to a member function bind_param() on boolean $values = '?'.str_repeat(',?', 59); $para = str_repeat("s", 30); // php Var $raceclassname ='$raceclassname1'; $bikeID = '$bikeID1'; // db Var $RaceClassName ='$RaceClassName1'; $BikeID = '$BikeID1'; for ($i = 2; $i <31; $i++){ $raceclassname = $raceclassname.',$raceclassname'.$i; $bikeID = $bikeID.',$bikeID
  4. I have 60 plus fields to update and was looking for a better way to write the prepared statement. Doing something like this is prone to many errors. INSERT INTO tabel (MemID,MemName,RaceNo,Make,Status....x60...) VALUES (?,?,?,?,?,?.....x60....) Thanks.
  5. mm A bit confused, I created 3 new forms, index, header, login with the minimum bits in them and it works fine. The value was taken through. I'll try the php's error reporting set to E_ALL. New to me. UPDATE Something is screwy here, now my original code is working with no changes. Possibly I had another page open and this caused issues with the current page's session. Is this possible and can I do something about it ?
  6. This is a bit confusing. To use session variables, I put the following on the start of each page <?php session_start(); // Start the session ?> and I initialize the variables on the index.php page <?php $_SESSION['memID'] = ''; $_SESSION['bikeID'] = ''; ?> On the index.php page I use an include('header.php') file that displays the logo etc and on the right had side, I display my session variables for debugging, all ok. index page works. Now I navigate to the next page and header.php now can't find the session variables. undefined index. So it look lik
  7. I I have looked at prepared statements and it is not high in my priority list at the moment. Something new to learn. I will rise later but I'm still getting my head around CSS HTML PHP etc. I really takes a while to understand enough to make a few things work. I do use mysqli_real_escape_string() in some routines, however bikeID is a value derived from a SQL field. If there is no user input field to enter information, is there still a possibility of a SQL Injection attack ?
  8. it is only your consensus at this point. By the same token, neither can you learn. Comments like these do nothing for anyone. If you read any books about teaching, coaching, etc you have to win the trust of your student before they will listen to you. Your comments earn very little trust. I can say you spend too much time 'answering' every ones posts, you need to get out more. Chances are you wont listen to me unless you have trust in me.
  9. This appears to work. if (isset($_GET['bikeID'])){ $_SESSION['bikeID']=$_GET['bikeID']; } //// $sql_bike = 'SELECT * FROM bikes WHERE BikeID = "'.$_SESSION['bikeID'].'"';
  10. I've used what you have suggested but that only solves the one form.. I have another table that lists bikes and that needs to look up each bike and populate some of the fields. I was hoping to use the same routine for both. Currently I use both below and am looking for a way to make it into one. $sql_bike = 'SELECT * FROM bikes WHERE BikeID = "'.$_GET['bikeID'].'"'; $sql_bike = 'SELECT * FROM bikes WHERE BikeID = "'.$_SESSION['bikeID'].'"'; The second form is quite a complex one. Just for interest. while($row_event_mem = mysqli_fetch_array($tbl_event_mem))
  11. I've tried a few options, needless to say, none worked. I have a routine that is common to two HTML pages. I'm trying to pass a variable to that routine using $_SESSION['bikeID'] but can't get anchor one to work. <td><a href='mem_bike.php?$_SESSION["bikeID"]=<?php echo $row_bikes['BikeID'];?>' > Any suggestions Thanks.
  12. I was hoping to make a generalized footer for my pages. I though this was working but the SQL update is never run. Can it be made to run ? I probably have a concept of HTML wrong. !! Close but no cigar. <body> <?php require ('sql_get_data.php'); if (isset($_POST['submit'])){ require ('sql_update_mem.php'); } ?> <div style="text-align: center;"> <form id="b_data" action="" method="post"> <input type='text' name='MemName' value='<?php echo $row_data['MemName'] ;?>
  13. I'm new to HTML PHP etc. You have clarified my thoughts. Do all the PHP stuff then display the page. I gather that my code as in #2 puts the pointer on the selected record as the page is painted. My original code/thought would have painted the picture and then positioned the pointer on the selected record. So I'm beginning to think to find the newly selected record, my only option is JS.
  14. I haven't see this done before but it works perfectly. Get data from both tables first. require ('sql_A.php'); // Data require ('sql_B.php'); // List source <select id='data'> <?php while($row_A = mysqli_fetch_array($result_A)){ $selected=''; if ($row_A['feildname'] == $row_B['feildname']) { $selected='selected'; }?> <option value="row" <?php echo $selected;?> > <?php echo $row_B['feildname];?> </option> <?php }?> </select> Now I just have
  15. My basic question is about the actual timing of events on an HTML page I have a page and on that page I have a <select> item list. I want to position the select index on a predetermined position based on a SQL result. The page does an SQL query to return a set of results. One of the fields needs to get its data range from another table and then set the the select index to the matching field. The function to set the matching field is along the lines of <script> function getposition() { document.getElementById("Name").value = <?php echo $row['Nam
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.