AyKay47
Members-
Posts
3,281 -
Joined
-
Last visited
-
Days Won
1
Everything posted by AyKay47
-
Can you please paste the code to this thread Don't use $_SERVER['PHP_SELF'] as a form action...you can use "#" instead... Another Language =
-
you could also use table notation "SELECT Rooms.ResType, Rooms.ID, Rooms.Name, Rooms.Description,Equipmen.ID,Equipment.Name,Equipment.Manufacturer FROM Rooms, Equipment ORDER BY Rooms.Description" however a UNION in this case would be more effificent
-
well the AND would only work if you tried to submit the same address AND email, if you tried to submit the same email but a different address, it would still work....my error sorry about that..fixed now
-
lets change the AND to an OR $result = mysql_query("SELECT * FROM database WHERE email = '$email' OR address = '$address'") or exit(mysql_error()); //check for duplicates I don't see how that would fail
-
if you only want to display one row, you can probably get away with simply taking away the while loop...mysql should grab the most current row where userid = $_SESSION['userid'] $query = "SELECT * FROM privateleague WHERE userid = '{$_SESSION['userid']}'"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_assoc($result); print $row['privateleaguename'] . "<br />"; print $row['privateleaguepasscode'];
-
no problem, let me know if you have issues with it
-
your code needs revising <?php $con = mysql_connect("host","username","password"); //fill in your data if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("database_name"); //insert appropriate data //declare variables $name = $_POST['name']; $address = $_POST['address']; $city = $_POST['city']; $state = $_POST['state']; $zip = $_POST['zip']; $cell = $_POST['cell']; $email = $_POST['email']; $info = $_POST['info']; $result = mysql_query("SELECT * FROM database WHERE email = '$email' AND address = '$address'") or exit(mysql_error()); //check for duplicates $num_rows = mysql_num_rows($result); //number of rows where duplicates exist if($num_rows == 0) { //if there are no duplicates...insert $sql="INSERT INTO database (id, name, address, city, state, zip, cell, email,info) VALUES ('','$_POST[name]','$_POST[address]','$_POST[city]','$_POST[state]','$_POST[zip]','$_POST[cell]','$_POST[email]','$_POST[info]')"; if (!mysql_query($sql)) { die('Error: ' . mysql_error()); } } mysql_close(); header ("Location: /cc-common/contests"); // Your code here to handle a successful verification //}; ?>
-
Problem updating fields in MySQL database with PHP.
AyKay47 replied to 00stuff's topic in PHP Coding Help
yeah empty should fix that -
Why i am retrieving only 1 row from my data base
AyKay47 replied to murli800's topic in PHP Coding Help
might be because you dont have it inside a loop...try while($dep = mysql_fetch_assoc($result1)){ print_r($dep); } honestly I am not sure about this one...however i think that since you do not have your mysqll_fetch_array inside of a loop, it is only grabbing the first row, therefore your print_r will display one row -
inserting session name into Update Query
AyKay47 replied to jerryhughes70's topic in PHP Coding Help
just needed that nudge... -
you can try to put the browser to "quirks" mode, while still maintaining the reminder of the level of XHTML you are writing..try writing the doctype like this <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> //remove URL
-
Problem updating fields in MySQL database with PHP.
AyKay47 replied to 00stuff's topic in PHP Coding Help
if you only want the update query to run if all of the data is submitted, you will need to combine your input validations.. if (!empty($password) && !empty($access_level) && !empty($name)) { $queryreg = mysql_query("UPDATE user_acl SET name = '$name', password = '$password', account_type = '$access_level' WHERE id = $id "); } if(!$queryreg) { print mysql_error(); } Edit: this is a continuation of Pikachu2k's post before mine -
inserting session name into Update Query
AyKay47 replied to jerryhughes70's topic in PHP Coding Help
$test = mysql_real_escape_string($_POST['FOOTBALL']); $name = $_SESSION['name']; $sql = "UPDATE upc SET FOOTBALL='$test' WHERE Name = '$name'"; $updateresult = mysql_query($sql) or die(mysql_error()); echo 'Picks Complete'; note that you will need to declare session_start at the beginning of your script -
good catch mjdamato thank you, only thing i'll add is the forward slash will not need to be escaped since the OP is using the # delimiter preg_match_all("#<p[^>]*>(.*?)</p>#i", $contents, $matches); nothing major though
-
Help with retrieving data from mysql with ajax
AyKay47 replied to DataSpy's topic in Javascript Help
lol...i'm sure you aren't stupid well the AJAX link that I gave you will give you a step by step on creating an AJAX xhr and will give examples of sending data to a php file via the get and post methods -
of course sorry, that code is meant to check to see if the canvas element is emulated in the browser, IE seems to have problems with the canvas element, need to force it, however I do not know what browser the OP is using so it's hard to pinpoint the exact issue.
-
Help with retrieving data from mysql with ajax
AyKay47 replied to DataSpy's topic in Javascript Help
have you looked at the links I provided? this really isn't difficult, basically you will want to use an onblur event that will call an AJAX/Jquery function that will get the customer data from your php file -
have you debugged your mysql query? what are your actual results?
-
Help with retrieving data from mysql with ajax
AyKay47 replied to DataSpy's topic in Javascript Help
is the customer information stored inside of a database? If so, you will need to use a server side language to extract the data, preferribly PHP of course. For this i would recommend you use either AJAX or JQuery https://developer.mozilla.org/en/AJAX http://jquery.com/ -
have you run it through the w3c validator?
-
or even table declaration
-
make sure that your document is valid XHTML
-
why are you using PHP4!?
-
I'm terribly sorry then Fenway, my apologies..I thought you were talking about my reply...however your reply did make me look back at the original post and realize that it is much more messy than I thought...
-
yeah, sorry MrAdam, OP I would suggest wrapping createElement and initialize it var cnvs = document.createElement('canvas'); window.G_vmlCanvasManager && (cnvs = G_vmlCanvasManager.initElement(cnvs));