Walker33
-
Posts
78 -
Joined
-
Last visited
Never
Posts posted by Walker33
-
-
I apologize in advance, but I'm very new to PHP. Dumped code last night when frustrated, but I was along the lines of this:
<?php
$query = mysql_query ("SELECT * FROM Failures");
$result = mysql_fetch_assoc ($query);
$parts = explode(" ", $result['Name']);
SET FirstName = '$parts[0]';
SET LastName = '$parts[1]';
echo "confused and frustrated";
}
?>
Not even getting the echo output. And I'm not sure once it's separated how to Insert it into proper new fields, but some of these suggestions are already helping.
-
I'm trying to clean up a DB and separate full name entries into firstname/lastname fields, and I believe I should use explode, but I can't seem to get it right, no matter what I've tried.
Table is customers, full name field is Name, names are currently inserted
first, space, last. New fields I want them in are FirstName, LastName.
Any help on this would be greatly appreciated. Thanks in advance.
[SOLVED] Explode function
in PHP Coding Help
Posted
Yes, every name is always first, space, last, no middle initial, no hyphens. And yes, CnP'd that, as I dumped what I had, but it was along those same lines. Finally, first time in a forum, first time posting questions, so very new to asking questions. Thanks for bearing with me. Just trying to learn.