-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
did you even try my last post ?
-
try this preg_match('/' . preg_quote($variant, '/') . '(?:\s|\?|,|!|\'|"|\.)?/', $shebang
-
mysql_fetch_array does both associative and indexd so 30 is correct try this $edit_question = mysql_query("SELECT * FROM intro WHERE id = {$_GET['ID']}"); while($question = mysql_fetch_assoc($edit_question)) { foreach($question as $K => $V) { $field_name = mysql_field_name($edit_question, $i); echo "<tr><td>$K</td><td>$V</td><td><input type=\"textarea\" /></td></tr>"; } }
-
wrong section, try the regex section also if you need help with something we need to see what you have so far! also what punctuation marks ? heres an example (\w) hyphenated words example (\w+(?:-)?(?:\w+)?(?:\.|\?|\w|\')+)
-
[SOLVED] Form button not working first time through loop.
MadTechie replied to sg1psychopath's topic in PHP Coding Help
after re-reading your first post.. the code has nothing to do with dlist.php so i don't see how the problem could be their! -
sizeof AKA count returns the number of items, in an array, the array starts from 0, so you need to remove one from the count, see below <?php $edit_question = mysql_query("SELECT * FROM intro WHERE id = {$_GET['ID']}"); while($question = mysql_fetch_array($edit_question)) { for($i = 0; $i < (sizeof($question)-1); $i++) { $field_name = mysql_field_name($edit_question, $i); echo "<tr><td>$field_name</td><td>$data</td><td><input type=\"textarea\" /></td></tr>"; } } ?>
-
[SOLVED] Form button not working first time through loop.
MadTechie replied to sg1psychopath's topic in PHP Coding Help
try this <?php $i=1; while($row = mysql_fetch_array($choiceresult)) { $i++ echo '<tr> <td>'.$i.'</td> <td>'.$row[1].'</td> <td>'.$row[2].'</td> <td>'.$row[4].'</td>'; if ($row[3] == 0) { echo '<td>   </td> <td>No</td>'; } else { echo '<td>'.$row[5].'</td> <td>Yes</td>'; } echo '<form action="dedit.php" method="post"><input type="hidden" name="editid" value="'.$row[0].'" /> <td><input type="submit" value="Edit" /></td> </form> </tr>'; } ?> -
do you have some sample data of the database.txt file, as i am not sure what i am working with here.. your using double base64_decode but no encodeing with would mean it would only allow you to exit it once!
-
foreach($decoded as $dec) won't work it needs to be an array not a string i don't understand the problem here, can you explain that a little clear please
-
yeah, i know (after you posted, Not quite. post) but you can tweak the fetch to fit the build.. if you get what i mean
-
try this $query = "SELECT id FROM events WHERE MONTH(date) = $m ORDER BY date";
-
have you used curl to login ? if not you can't change the password
-
Solved? can you click solved please, saves other read this thread wanting to help
-
change echo "<option value=$it->target>$it->target</option>"; to echo "<option value='$it->target'>$it->target</option>"; Note the quotes EDIT: without the quotes its values is the test until with a > or a space is hit, with the quotes it takes the value until the closing quote is hit
-
true, but mysql_fetch_array can fetch both associative and indexed (by default) using $row = mysql_fetch_array($result, MYSQL_BOTH); EDIT: No no Barand your very correct , (now i think about it) i get your point
-
well if thats not what your asking then just say so.. your question is confusing, (it hardly seams like you even asking one) never mine happy coding
-
[SOLVED] Extremely strange behaviour using FWRITE
MadTechie replied to neutra's topic in PHP Coding Help
well 4.4.8 was the last version 4 so it maybe worth upgrading infact php4 has been discontinued for over 5 mouths.. if this is a major project wouldn't it be better to use version 5, as 6 is coming out soon. if you use wildteen88 code as a basis for all the interaction with the files you should be able to find the exact problem. -
[SOLVED] Extremely strange behaviour using FWRITE
MadTechie replied to neutra's topic in PHP Coding Help
before i read all that.. what were the results of wildteen88 test? -
for some reason the IN doesn't like a varchar so i changed it to suite <html> <head> <title> Inventory </title> </head> <body> <div align=center> <br><br><br> <?php $sql = mysql_query("SELECT * FROM Account WHERE AccountID = '{$_SESSION['id']}'"); $row = mysql_fetch_array($sql); $APL = $row['AccountProductList']; $AccountID=$row['AccountID']; $AccountName=$row['AccountName']; ?> <b>Account ID</b>: <?php echo($AccountID); ?> | <b>Account Name</b>: <?php echo($AccountName); ?> <br><br> <?php $getaccountlist = mysql_query("SELECT * FROM Products WHERE ProductID IN ($APL) ORDER BY ProductType"); echo " <table> <tr> <td align=center colspan=4> <b>Shirts</b> </td> </tr> <tr> <td> Product ID </td> <td> Product Name </td> <td> Product Type </td> <td> Product Price </td> </tr>"; $type = ""; while($row = mysql_fetch_array($getaccountlist)) { $UserProductID = $row['ProductID']; $UserProductName = $row['ProductName']; $UserProductType = $row['ProductType']; $UserProductPrice = $row['ProductPrice']; //this If create headers for each type if($type != $UserProductType) { echo "<tr><td colspan=\"4\">$UserProductType</td></tr>"; $type = $UserProductType; } echo " <tr> <td> ".$UserProductID." </td> <td> ".$UserProductName." </td> <td> ".$UserProductType." </td> <td> ".$UserProductPrice." </td> </tr>"; } echo "</table>"; ?> </div> </body> </html>
-
do you mean <?php $username = $row['username']; $password = $row['password']; $etc = $row['etc']; //or extract($row); //or foreach($row as $k => $v) { $$k = $v; } //or list($username, $password, $ect) = $row; ?> all do the same
-
yes but unneeded the update will break them up, well kinda.. your see what i mean, in thelast update i forgot to update the SQL so change $getaccountlist = mysql_query("SELECT *.Products FROM Products, Account WHERE ID IN (Account.AccountProductList) ORDER BY ProductType"); to $getaccountlist = mysql_query("SELECT *.Products FROM Products, Account WHERE Products.ProductID IN (Account.AccountProductList) ORDER BY ProductType");