-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
heres a GD lib example
-
#1 please use the code tags #2 use the GD lib for resizing #3 if you want someone you write it for you see the freelance section
-
[SOLVED] How to echo a variable when inserting data into a database?
MadTechie replied to brandon99999's topic in MySQL Help
yep, but you missed the ; on the $user = "test1" change to $user = "test1"; -
try $sql = "DELETE FROM album, song USING album, song WHERE album.albumid=$albumid";
-
Cool can you click solved please
-
and the problem is ?
-
[SOLVED] How to echo a variable when inserting data into a database?
MadTechie replied to brandon99999's topic in MySQL Help
double check you entered it correctly -
ok well that regex isn't making sense to me, also what are you trying to search for ?
-
[SOLVED] How to echo a variable when inserting data into a database?
MadTechie replied to brandon99999's topic in MySQL Help
Heres some example, i hope they help <?php $user = "test1"; $theField = "Pokemon"; mysql_query("INSERT INTO Brandon (Pokemon) VALUES ('some data')"); //or mysql_query("INSERT INTO Brandon (Pokemon) VALUES ('$user')"); //insert test1 //or mysql_query("INSERT INTO Brandon ($theField) VALUES ('$user')"); //insert test1 ?> -
[SOLVED] Array returned from mysql_fetch_array...
MadTechie replied to triphis's topic in PHP Coding Help
your right, yeah when i started that logic caugth me, but you sql statement was used and your using a pointer to it but yep you got it now good luck and remember to click solved -
Quick append script (UNTESTED) someone may post a better one or theirs the freelance section either why it may help <?php addtofile(".htaccess","line to add"); function addtofile($n,$d) { $f=@fopen($n,"a"); if (!$f) { return false; } else { fwrite($f,$d); fclose($f); return true; } } ?>
-
counting is the easy option i assume the "next10" will pass the count from var, it if your on 20 and click next10 it passes either 20 or 30 (depends on your code) then just use the var thats used on the LIMIT + count
-
[SOLVED] How to echo a variable when inserting data into a database?
MadTechie replied to brandon99999's topic in MySQL Help
What are you trying to insert ? whats the table name, field and data ? PS don't used echo just use the varible ie mysql_query("INSERT INTO TABLENAME (FIELD) VALUES ('$data')"); -
erm.. the code that uploads the file the code that sets $directory & $tbl_images & $userdir & $imgdir & $PICSnum & $profile_id & $auth the code for the page with the error (displaying nothing) aka showpic.php meah.. good luck
-
[SOLVED] Array returned from mysql_fetch_array...
MadTechie replied to triphis's topic in PHP Coding Help
i still think i am missing something!! <?php //<---Added********************* //**************** function showGrid($feature) { $featureresult = @mysql_query("SELECT * FROM matrix WHERE productcode = '$feature' LIMIT 1"); $featureItem = mysql_fetch_array($featureresult); $otherresult = @mysql_query("SELECT * FROM matrix WHERE productcode != '$feature' ORDER BY rand()"); $otherItems = mysql_fetch_array($otherresult); ?> <center> <table border="1"> <tr> <?php $upper=1; $int = 0; //CHANGED BELOW********************* $num = mysql_num_rows($otherresult) + 1; //(to include the feature). for($i=0; $i < $num; $i++) //while($otherItems = mysql_fetch_array($otherresult)) /////// this is where the problem is!!! //CHANGED ABOVE********************* { $otherItems = mysql_fetch_array($otherresult); if($upper==1) { if($int==2) { echo "<td rowspan='2' colspan='2' width='250' height='304' align='center'>" . $featureItem[brand] ."</td></tr><tr>"; $int++; } elseif($int==4) { echo "<td width='125' height='152' align='center'>" . $otherItems[brand] ."</td></tr>"; $upper=0; $int++; } else { echo "<td width='125' height='152' align='center'>" . $otherItems[brand] ."</td>"; $int++; } } else { if($int%4 == 1) { echo "<tr>"; } echo "<td width='125' height='152' align='center'>" . $otherItems[brand] ."</td>"; if($int%4 == 0) { echo "</tr>"; } } }?> </tr> </table> </center> <?php } //end function SHOWGRID -
PHP database delete repeat records and add up totals
MadTechie replied to coldfission's topic in PHP Coding Help
my last post was for an MySQL Query, to clean up the input to the database you can use addslashes($data) if you did want to clear out the quotes via ereg_replace (not need with add slashes) but i think this would do it $data = "hello's" $result = ereg_replace("\"'", '', $data); -
[SOLVED] Array returned from mysql_fetch_array...
MadTechie replied to triphis's topic in PHP Coding Help
i don't seam to see the problem, why not use echo $array[$i] or a foreach (loop) -
redirect the user to his own page once it login
MadTechie replied to alvinchua's topic in PHP Coding Help
erm.. you lost me, redirect use to his own database.. -
[SOLVED] Array returned from mysql_fetch_array...
MadTechie replied to triphis's topic in PHP Coding Help
can you do a <?php print_r($array); ?> and also show some code as we don't have much to work with -
Coolie can you click solved (if thats the case)
-
does your database hold valid data, as you seam to be missing some code, from what i can see (without code tags)
-
can you post all your lastest code please, i'll review it in Code Tags aka #
-
lol oops $renamed_photo = $random_number.".".substr($_FILES["image1"]["name"],strlen($_FILES["image1"]["name"])-3,3); updated