taquitosensei
Members-
Posts
676 -
Joined
-
Last visited
-
Days Won
2
Everything posted by taquitosensei
-
[SOLVED] Why am I getting a "Notice: Undefined variable"
taquitosensei replied to jamcoupe's topic in PHP Coding Help
put $articledata=NULL; just before the query you can also then remove the else -
I think they meant register globals. Which is when a variable is automatically registered for the keys in $_REQUEST for example website.php?blah=whatever with out doing anything you would have a variable available $blah same thing for posted data. GIANT security hole.
-
try this echo "<input id='customer' name='customer' size='30' type='text' value='".$row['title'] ." ". $row['firstname'] ." ". $row['surname']."' />";
-
this is how you would redirect. header("Location: mysite.com/admin.php"); you'll want some validation code to determine whether or not to redirect
-
what kind of issues. saying "but I'm having issues" is like. It's broke, fix it. Also where's your second loop. The code that actually builds the html from the loops etc.. There's probably a better way to do the queries, combine them into one, etc.. but we need more information.
-
[SOLVED] Square Brackets after variable -- what does this do?
taquitosensei replied to danludwig's topic in PHP Coding Help
It adds to the array with the index being the next numerical value. If you have this $array[1]="blah"; this $array[2]="whatever"; and $array[]="whatever"; are the same thing I don't think php allows null keys. Numerically indexed arrays are generally accessed in a loop. If you need to access by a specific index. You would use an associative array. $array['myname']="Mr. Coffee"; -
I think you need to use strtotime to convert to a unix timestamp $s=date('Y-m-d',strtotime($sDate)); $e=date('Y-m-d',strtotime($eDate));
-
There's probably better ways but this should would work $counter=0; $handle = fopen("contacts.csv", "r"); while(($data=fgetcsv($handle,1000,",")) !== FALSE) { if($counter < 1000) { } $counter++; }
-
look into ON DELETE CASCADE you'll have to change add a foreign key here's some more info http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html
-
You'll have to give us more than that. The string you're trying to decode and the Code you're using to decode the unicode. The results you're expecting. That's like saying. My car doesn't work. What's wrong with it?
-
you're overwriting $year with results from your query. while ($row=mysql_fetch_array($result)) { $year=$row["year"]; $options.=" <a href=\"news?id=$year\">".$year."</a> |"; }?> since it's descending and 2006 is the earliest year that's what it ends up as
-
I would change your table structure a bit. Instead of having 3 separate tables. Try this Categories Category, CategoryID category being News, League, etc Comments CommentID, CategoryID, UserID, Comment, CommentDate then you put all comments in that table and you just separate them by the category as you need to.
-
something in config.php is outputting to the screen. Or you have a space before before one of the <?php's
-
you $dbc for your connection but I don't see where you set it. I'll bet if you do a print_r($dbc); it won't give you anything.
-
[SOLVED] Reading speical characters from MySQL DB.
taquitosensei replied to iPixel's topic in PHP Coding Help
microsoft word uses UTF-8 you'll have to add this at the top of your page header('Content-Type: text/plain; charset=utf-8'); -
the @ sign stops any errors from reporting. I would remove the @'s and turn on error reporting for that page with this at the top ini_set("display_errors","1"); ERROR_REPORTING(E_ALL); that will then let you know if there's any errors.
-
use left join, build an array then work from that $query="SELECT * FROM albums LEFT JOIN photos on albums.album=photos.album"; $result=mysql_query($query) or trigger_error("Query: $query\n<br />MySQL Error: " . mysql_error()); $i=0; while($albums=mysql_fetch_array($result)) { $array[$albums['album']][]=$albums['photo_url']; } foreach($array as $name=>$photos) { print "<div class=\"album_cover_right\">"; foreach($photos as $cover) { print "<div class=\"album_image\"><img src=\"$cover\"/></div>"; } print "<div class=\"album_link\"><a href=\"http://localhost/gallery/album/$name/\" class=\"list\">$name</a></div>"; } this isn't checked for any typos
-
date_format is a mysql function it won't work in php. for php you'll need to use date("m-d-Y", strtotime($date));
-
you need to use double equals or triple if you're trying to match data type also. == or === if you use single equals you're setting the value instead of comparing it.
-
You should use something that does syntax highlighting for writing your code. Something along the lines of "notepad plus" That way you can see where something went wrong, make it easier to locate the problem. The error you're getting could be mismatched or missing brackets, braces, single quotes, double quotes, semi colon etc..
-
[SOLVED] Error uploading big files to MySQL Blob
taquitosensei replied to TeeJokey's topic in PHP Coding Help
I found this under BLOB's description on the MySQL site. The maximum size of a BLOB or TEXT object is determined by its type, but the largest value you actually can transmit between the client and server is determined by the amount of available memory and the size of the communications buffers. You can change the message buffer size by changing the value of the max_allowed_packet variable, but you must do so for both the server and your client program. -
What information do you need from it before you insert it into your database? This should be all it takes. $fh=fopen($file, "r"); $data=addslashes($fh, filesize($file)));
-
1. Yes 2. Most of the time. Post Code
-
I just copied and pasted and it worked fine. Is it possible that it's saved as a .html or .htm instead of .php. If it is then it may be that your web server is not setup to parse php in html files.