
digitalgod
Members-
Posts
374 -
Joined
-
Last visited
Never
Everything posted by digitalgod
-
[SOLVED] Selecting rows from multiple numbers
digitalgod replied to forumnz's topic in PHP Coding Help
beat me to it sasa -
depends of what you're doing, since strlen returns an integer you need to check if the length is 0. if you would have done if($someName == 0) that would check if your variable is FALSE
-
0 is for strlen, meaning if the string has a length of 0 as opposed to "" which just means that the value inside your variable is basically empty
-
you mean from a datetime field? SELECT date_format( yourcolumn, '%c/%e/%Y %T' ) FROM table
-
[SOLVED] Not sure why info is not INSERT into the db?
digitalgod replied to Clinton's topic in PHP Coding Help
there's a space in your table's name, you need to use backticks -
[SOLVED] Not sure why info is not INSERT into the db?
digitalgod replied to Clinton's topic in PHP Coding Help
try putting the table name between backticks `` and add a or die(mysql_error()) to your insert query in order to see what's the error you're getting -
switch those 2 $_POST['some_name'] = $some_name;
-
change $imagename = $_FILES['new_image']['name']; to whatever you want, you can even generate a random name using rand() as for the db part just add an INSERT query before echo "<img src='Lost/".$imagepath."'> might want to use sumfight's exception handling to see whether or not the image has been uploaded and resized before inserting in your db
-
<?php $someName = stripslahes(mysql_real_escape_string($_POST['some_name'])); if( $someName != "" ) { // insert } else { //error }
-
try <? $fileName = "../name.txt"; $fh = fopen($fileName, 'r'); $exists = file_exists($fileName); echo $exists; $nameB = fread($fh, filesize($fileName)); echo $nameB; $name = explode("\n",$nameB); fclose($fh); $fileName = "../var.txt"; $fh = fopen($fileName, 'r'); $varB = fread($fh, filesize($fileName)); $var = explode("\n",$varB); for ( $id = 0; $id <= $maxid; $id += 1) { echo "<option value='$var[$id]'>$name[$id]</option>"; } fclose($fh); ?>
-
[SOLVED] Writing CSV File Data Into MYSQL Database
digitalgod replied to winmastergames's topic in PHP Coding Help
and is it working? you need to setup a cron job so that your script runs daily. If you have a panel like cpanel there's an option in there to setup cron jobs. -
it would really help if you told us what errors you're getting or if you're not getting any what happens when you submit.
-
if you check your img src it looks like this Georgia Farm & Forest\Bartow\Bartow 9520\Images\IMGP1202.JPG I would suggest just having the name of the image in your database and then do this echo "<img src=\"images/$showcase_image\" width=\"100\" height=\"100\" align=\"middle\" >"; or wherever your images are located also it's much cleaner if you remove all those echo and do something like <table cellspacing="15"> <? while($row = mysql_fetch_assoc($result)) { extract($row); ?> <tr><td> <img src="<?=$showcase_image?>" width="100" height="100" align="middle" > <?=$prop_title?> <?=$prop_desc?> <a href="showdetails.php?id_number=<?=$id_number?>"><div align="right">View Details</div></a>"; </td></tr> <? } ?> </table> but that's just a matter of personal taste
-
hey guys, ok not sure how I'll explain this but here goes I have 2 tables members +-------+-------------+---------------+ | id | username | email | +-------+-------------+---------------+ | 1 | user1 | [email protected] | | 2 | user2 | [email protected] | | 3 | user3 | [email protected] | +-------+-------------+---------------+ friends +-------+-------------+---------------+ | id | owner | member | +-------+-------------+---------------+ | 510 | 18489 | 3 | +-------+-------------+---------------+ I want to select all the members that match an array of emails like so SELECT id,username FROM members WHERE email IN ( '$list' ) but at the same time I don't want it to return results for entries that are in the friend table. So say that my id is 18489 and that I'm looking for [email protected], [email protected] and [email protected] it will only return id 1 and 2 because id 3 is in the table friends and I ("owner" 18489) am the owner.. what do I have to add in my initial query in order to achieve that don't know if that makes any sense... any help would be greatly appreciated!
-
thanks Crayon I'll give it a shot. why the "" sasa? I'll try it both ways
-
I use a combo of Dreamweaver and Intype, still in beta but I love it
-
Don't mind the missing FROM in my $query example. I could have sworn there was a Modify button but all I see is Quote...
-
hey guys, say I have an array of emails that I'd like to verify if they exist in a db, would there be a better way than having a select query for each email? something other than <? for ($i=0; $i < $max; $i++) { $query = "SELECT id WHERE email = '" . $aEmail[$i] . "' " $result = mysql_query($query) or die(mysql_error()); $numRows=mysql_num_rows($result); // etc... } ?>
-
just replace $sql = "SELECT * FROM tbl WHERE id=$id"; with whatever column you're using for id in your db, as well as the table name
-
that's because you're using the assignment operator, you should use "==" without the quotes, you should also add quotes to Yes and No so your code should look like this if ($row[exemption_type]=='Yes'){ some code } else if($row[exemption_type]=='No'){ some code } else echo "Error";
-
I don't know about attachments but yes I was able to parse emails, where are you having problems?
-
there's an entire section dedicated to tutorials for phpDoc on their site, it can be found here http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.pkg.html
-
it's actually exactly the same, nothing changed that's why I'm wondering if I did anything wrong
-
is there something else I should be doing in order for tidy to work?