taquitosensei
Members-
Posts
676 -
Joined
-
Last visited
-
Days Won
2
Everything posted by taquitosensei
-
Trouble reading an array posted from another site
taquitosensei replied to jmurch's topic in PHP Coding Help
try serialize and unserialize <input type="hidden" name="address_array" value="<? echo serialize($address_array); ?>"> $address_array=unserialize($_POST['address_array']); -
trouble with comparing time differences...
taquitosensei replied to Eggzorcist's topic in PHP Coding Help
it was supposed to be "fromslashes". I made a typo. It gets all the records in "fromslashes" that are between today and today + 5 days -
trouble with comparing time differences...
taquitosensei replied to Eggzorcist's topic in PHP Coding Help
you should always use the datetime data type for dates. You can then change the format in your query if you need to. with addslashes as a datetime select * from events where user='".$_SESSION['USER']."' and addslashes between '".date("Y-m-d H:i:s")."' and '".date("Y-m-d H:i:s", strtotime("+ 5 days"))."'"; -
[SOLVED] split variable for only the last 4 digits
taquitosensei replied to DrTrans's topic in PHP Coding Help
substr $variable=substr($row['TaxID'],-4); to get the first part $variable=substr($row['TaxID'],0,-4); -
Sweet. Now you'll want to read up on LEFT and RIGHT Joins. It will save you headaches if you have to do much more in the way of joins.
-
I guess I misunderstood I thought he wanted it to happen when they clicked the checkbox.
-
you can't do what you're wanting to do with php only. You have to have some javascript involved.
-
it will require either onClick posting it or onClick combined with ajax. onClick='this.form.submit();' then checking for the post and doing whatever you need to with the database.
-
close. I forgot the FROM. But that should be close.
-
if landordid in the landlord table is the primary key you don't need the limit 1. Also if the landlord can only have 1 capitalsquare you can do a unique key on the landlordid and capitalsquareid. Then you can do a join SELECT * UsersGeneral JOIN LandLord on UsersGeneral.LandLordID=LandLord.LandLordID JOIN MapSquares on LandLord.LandLordID=CapitalSquares.LandLordID WHERE UsersGeneral.Username='$name'
-
[SOLVED] Adding hack to PHP to mimick database row?
taquitosensei replied to ecopetition's topic in PHP Coding Help
more of a mysql question. But you'll want to use a UNION $sql = "SELECT first_name,surname,gender FROM names where surname=$input_surname and gender=$input_gender UNION select 'default_firstname' as first_name, surname, 'default_gender' as gender from more_names WHERE surname = $input_surname ORDER BY surname ASC"; you may have to tweak it some and it hasn't been test yet. But that should point you in the right direction. -
what version of php are you using?
-
if I understand what you're asking this would do it <ul> <li> <?php echo ($mypageVariable=="deathValue")?"<a id='uberlink2' href='#'>DeathValley</a>":"<a href='bio_deathvalley.php'>DeathValley</a>"; ?> </li> </ul>
-
[SOLVED] If column exists, if not..
taquitosensei replied to peter_anderson's topic in PHP Coding Help
$query = mysql_query("SELECT * from `page` WHERE id='$pg'") or die(mysql_error()); if(mysql_num_rows($query)) ==0) { header("Location: your404page.php"); exit; } $row=mysql_fetch_array($query); // The rest of your code here -
you have single quotes around the variable you're using as a keys. Either this isn't mean to be a variable in which case you need to drop the $ or you need to lose the single quotes. PHP doesn't parse variables in single quotes.
-
you should change your database structure. Storing comma separated values isn't a good idea store each number as a separate row header column a | header column b | header column c bla bla bla | more bla bla | 1 bla bla bla | more bla bla | 2 bla bla bla | more bla bla | 4 bla bla bla | more bla bla | 8 etc then delete from table where columnc in(1,2)
-
[SOLVED] Deleting from a database using an array
taquitosensei replied to perrij3's topic in PHP Coding Help
you forgot the "from" DELETE FROM image plus there's single quotes around the 9,10 where there shouldn't be. -
have an error in your SQL syntax HELP
taquitosensei replied to jigsawsoul's topic in PHP Coding Help
you have an extra single quote before $enquiryid -
you'll have to do a hidden field with your customerid. When you post you're not passing through the URL so you're losing your variable. <input type='hidden' name='customerid' value='".$_GET['Customer_ID']."'> then you'll have $_POST['customerid'] available on the page you posted to.
-
Return the name of each column in MySQL database
taquitosensei replied to malikah's topic in PHP Coding Help
I'm retarded and didn't see the PREPARED in bold. Ignore my post. -
Return the name of each column in MySQL database
taquitosensei replied to malikah's topic in PHP Coding Help
you can query the information_schema for your table SELECT * FROM information_schema.COLUMNS where table_name='yourtablename' -
[SOLVED] Code works in Firefox but not in I.E?
taquitosensei replied to DanielHardy's topic in PHP Coding Help
where's the html for your form? It could be that the html isn't validating and firefox is a little more forgiving than IE. -
It sounds like you haven't created the keys or crypt_gpg doesn't know where to look. Here's a guide to creating and using keys with crypt_gpg http://pear.php.net/manual/en/package.encryption.crypt-gpg.php
-
you'll need to find out where the binary gpg is and specify it like so $gpg = new Crypt_GPG(array('binary' => '/path/to/gpg'));
-
use implode $sql = "DELETE FROM messages WHERE id IN (".implode(",",$_POST['delete']).")"; to do it your way it would have to be $list.=$value; // not plus