Jump to content

tomtimms

Members
  • Posts

    114
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

tomtimms's Achievements

Member

Member (2/5)

0

Reputation

  1. You would need to use header('Location: http://www.example.com/');, do you want the redirect after the "Your Message Was Sent" text was seen or do you want to just redirect straight to a page?
  2. So I got it to work, however I am using a button to save and each time I save it keeps adding what I want to the end, I just need one instance of it. So code $('#billing_address_setting').attr('href', $('#billing_address_setting').attr('href') + 'site_id' + data); create http://www.mysite.com?a=100 and each time I click save it keeps adding 100, so it now looks like www.mysite.com?a=100100100 etc. How can I make it just post 1 time?
  3. It sure does, totally stumped.
  4. I get Error: $("#billing_address_setting") is null, and yes jquery q should be $
  5. I am trying to append a value to the end of my url however getting not a function error. any help? q('#billing_address_setting').attr('href').append('site_id'+data);
  6. I am trying to replace a [href] attributes with php code in a jquery return. Here is what I have so far. $('#account_setting').attr('href', '<?PHP url_for('Account/Settings/site_id/'+data) ?>'; I am not sure what I have wrong, as it gives me "missing )" error code.
  7. what is cal_id? Are you querying the database for a day of the week, to get that day of the weeks price? So your table is like cal_id : Price Monday : 90 Tuesday: 50
  8. Do you have to have the rates in an array? Can you just give each day a variable name and assign it a value? $modnay = 91.11 etc ?
  9. You need to use your while loop on the entire hidden tag. Then I assume you just lump all of them into an array and do a foreach on your Update query. <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { foreach($shipid AS $id){ $updateSQL = sprintf("UPDATE ships SET HealthA=%s WHERE ShipID=%s", GetSQLValueString($_POST['healtha'], "int"), GetSQLValueString($_POST['shipid'], "text")); //add your ship id somewhere after this or on this line? } } ?> <input name="healtha" type="hidden" id="healtha" value="<?php echo $row_Ships['HealthA'] + 1; ?>" /> <?php while($row = mysql_fetch_assoc($Ships)) { ?> <input name="shipid" type="hidden" id="shipid" value="<?PHP echo $row['ShipID']; ?>" /> <?PHP } ?>
  10. Why not just get all your current db numbers into an array, and then create an array of 1-5000 numbers and just find the difference? http://php.net/manual/en/function.array-diff.php
  11. You would need to put each input element into an array. So .. <?php include("opendatabase.php"); ?> <FORM Method = "POST" action ="insert_spreads.php"> <?php $weekID = $_POST[Week]; echo "<h2>Enter Spreads for Week $weekID</h2>"; print ("<br /><br />"); $result = mysql_query(" SELECT S.game_id, TH.team_name AS HomeTeam, TA.team_name AS AwayTeam FROM schedule AS S JOIN teams AS TH ON S.H_team = TH.team_id JOIN teams AS TA ON S.A_team = TA.team_id WHERE S.week_id = '$weekID' ORDER BY S.game_id;"); $i = 0; //Counter while ($row = mysql_fetch_array($result)) { printf('<input type="text" size="4" name="w%dg%dAspread[' . $i . ']">', $weekID, $row['game_id']); printf(" %s vs. %s ", $row['AwayTeam'], $row['HomeTeam']); printf('<input type="text" size="4" name="w%dg%dHspread[' . $i . ']">', $weekID, $row['game_id']); print("<br /><br />"); $i++; } mysql_close($con); ?> <br /><br /> <input type="Submit" value="Submit Spreads"> </FORM> Then you would need to do a foreach in your form processing file.
  12. What are you trying to pass to your function?
  13. I am trying to do a like clause on a joined table, below is my query. SELECT SQL_CALC_FOUND_ROWS source, id, gross, id32 FROM ( ( SELECT a.source, a.id, a.gross, b.id32 FROM table1 a LEFT JOIN table2 b ON (a.source = b.id32 AND a.id = b.id32) WHERE a.date BETWEEN '2011-01-01' AND '2011-01-05' AND b.id32 LIKE '%201%' GROUP BY a.source,a.id )) AS tmp GROUP BY source,id The query doesn't give an error, however it just takes over 100 seconds to process. Anyone know what I could do to optimize this?
  14. Well then there are a few ways to do it. <?php function db_connect() { $result = new mysqli('localhost', 'root', 'password', 'books'); if (!$result) { die(mysqli_error($result)); return false; } $result->autocommit(TRUE); return $result; } function get_book_details($isbn) { // query database for all details for a particular book if ((!$isbn) || ($isbn=='')) { die(mysqli_error($isbn)); return false; } $conn = db_connect(); $query = "select * from books where isbn='".$isbn."'"; $result = $conn->query($query); if (!$result) { die(mysqli_error($result)); return false; } $result = $result->fetch_assoc(); return $result; } $book = get_book_details($isbn); //Not sure if I understood this right, however lets say Title is a field in your table. You can get an array of all the titles //from your query doing something like this. $book_title = array(); while($rows = mysql_fetch_array($book)) { $book_title[] = $rows['title']; $book_auther[] = $rows['authoer']; } //you can loop out each field you want. foreach ($book_title AS $title){ echo $title; //Or another way is to just do it inside your while loop. while($rows = mysql_fetch_array($book)) { echo $rows['title']; echo "<br/>"; echo $rows['authoer']; } } ?>
  15. http://www.phpf1.com/tutorial/get-current-page-url.html that link might help you, you need to use the $_SERVER to get the content you need.
×
×
  • 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.